freenode/#lisp - IRC Chatlog
Search
11:54:40
many-questions
When I step in slime, SLDB, emacs momentarily flashes a yellow highlight to show which form is being evaluated. Is there a way to make this flash longer, or even have a permanent highlight of the current form?
12:12:34
Xach
many-questions: that's an interesting question. i couldn't figure it out quickly from slime.el, but it can't be too tricky.
12:17:08
trittweiler
many-questions, There does not seem a way right now to configure this. To change the source code, you would want pass in a third parameter to slime-flash-region in slime-highlight-sexp
12:20:24
trittweiler
From an UI point of view, perhaps what should be done is to add a command that redoes the last flash.
12:31:41
Xach
trittweiler: can you tell me how sldb-step ties in to slime-highlight-sexp? I couldn't see the call sequence.
12:38:42
phoe
If a Common Lisp type is non-NIL and non-T, then can/should negating it ever produce a NIL or T type?
12:39:33
phoe
Set theory tells me that this should never be the case, since a negation of a non-empty/non-universe set is never an universe/empty set.
12:46:06
phoe
(NOT (OR (NOT INTEGER) (REAL (-0.5D0)) (REAL * (-0.5D0)))) is the smallest actual test case I've found that produces a NIL ctype on CCL and SBCL.
12:55:06
phoe
So this also must mean that (OR (NOT INTEGER) (INTEGER * -1) (REAL (-3.5D0)) (REAL * (-3.5D0))) is T.
12:55:36
phoe
And that (OR (NOT INTEGER) (INTEGER * -1) (REAL (-3.926510009989861D+7)) (REAL * (-3.926510009989861D+7))) is T.
13:26:24
trittweiler
Xach: grep for :show-frame-source in the *.el and *.lisp files. The control flow is not very apparent at all, you are right
13:27:47
phoe
First, somehow improve the type parsing, so CCL/SBCL can infer from the above type that it is equivalent to T.
13:28:19
phoe
Second, try and figure out why the hell (VALUES NIL T) is returned, which means that SBCL/CCL are *sure* that their decision is correct even if it is not.
15:42:33
pjb
phoe: it depends on whether "type-designator-1 IS type-designator-2" means the two type designators are identical, or whether they represent the same type, ie. the same set of values?
15:43:40
pjb
phoe: specifically, (and (not (equalp '(and (eql 1) (eql 2)) 'nil)) (subtypep '(and (eql 1) (eql 2)) 'nil) (subtypep 'nil '(and (eql 1) (eql 2)))) #| --> t ; t |#
15:44:03
pjb
phoe: but implementations may not be able to determine the subtype relationship in all cases!
15:45:23
pjb
eg. (defun always-nil (x) 'nil) (deftype few () '(satisfies aways-nil)) (and (subtypep 'always-nil 'nil) (subtypep 'nil 'always-nil)) #| --> nil |#
15:46:42
phoe
pjb: if the implementation is unable to determine the relationship, it must return NIL NIL.
15:52:16
jeosol
getting this sbcl specific error: dynamic space too small for core: 1912160KiB required, 1048576KiB available.
15:52:51
jeosol
when I try to load a core through slime. Works on the shell no issues. I do have a lot memory not used when I checked with top (~27GB)
16:04:19
phoe
I'll show you the commit when I'm done. Maybe SBCL has a similar place and you will be able to port it to SBCL.
16:18:52
phoe
https://github.com/phoe-trash/ccl/commit/ba281521b1cfbffe3c3b6ef0a56e27e425438f72?ts=8
16:22:21
easye
ACTION is really digging Travis with ABCL <https://travis-ci.org/easye/abcl/builds/613579263>
16:24:23
easye
As a public service, the Common Lisp Foundation also has Gitlab CI available to all users.
16:26:03
phoe
Travis has builds on macOS/Windows/Linux for free on github. Sourcehut has Linux/BSDs.
16:28:08
easye
"Correct under Linux means the vendors have the responsibility to make it work on their commercial offering."
16:28:53
easye
" maybe they can't get any CI utils to run on catalina": it's gonna take a little elbow grease, but they have the engineering talent and time to do it.
16:31:28
Bike
and in early-type.lisp it defines the cons type-class to have :might-contain-other-types nil
16:31:43
Bike
but given the description in the definition of type classes, i'm not sure just switching it is correct
17:58:22
phoe
Discussing with Bike on #sbcl made me realize that ccl::type-might-contain-other-types-p might not be what I think it means.
18:00:44
phoe
That is how it is used in SBCL internals. I wonder if that is also the case in CCL internals...
18:03:50
pjb
phoe: IMO, renaming is an important part of maintainance. ccl::type-might-contain-other-types-p -> ccl::type-might-be-a-subtype-of-other-types-p
18:05:21
phoe
and the only ctypes that satisfy TYPE-MIGHT-CONTAIN-OTHER-TYPES-P are hairy, negation, union, and intersection types
18:05:49
phoe
pjb: I'll rename it when I figure out what the hell it means and what the hell is it supposed to do
18:07:00
Bike
phoe: I think the idea is that an instance of a type-class is a type, and that, if a type-class does not "contain other types", instances of that type-class are disjoint from instances of distinct type-classes
18:09:39
phoe
Bike: CCL sources seems to agree with SBCL ones. The only four defined type classes in SBCL that have true might-contain-other-types are hairy, negation, union, intersection.
18:10:00
jjkola
pjb: as type of all types contains all types thus it must also contain type of all types otherwise it is not type of all types
18:10:38
phoe
So my CCL fix is incorrect and might likely cause SUBTYPEP to behave incorrectly - as in, the patched SUBTYPEP could return NIL NIL instead of NIL T
18:15:48
phoe
it likely needs to be smarter about merging ranges that end and begin on the same exclusive bound
18:18:12
Bike
if it's just a union type the ranges might as well be satisfies types for all it knows about them together
18:21:41
phoe
one thing is (or (real * (-0.5d0)) (not integer) (real (-0.5d0))) not being detected as a T
18:21:57
phoe
what is the other thing again? I mean the one you meant by 19:17 < Bike> no, you want it to also be smart enough to figure this othher thing out.
18:22:31
Bike
the analysis you're talking about doing is kind of predicated on the idea that (or (real * (-0.5d0)) (real (-0.5d0))) is handled more intelligently.
18:23:05
phoe
where you want to merge two ranges that neighbor but you need to find the point between them
18:23:46
phoe
because (specifier-type '(or (real * (-0.5d0)) (real -0.5d0 -0.5d0) (real (-0.5d0)))) ;=> #<NUMERIC-CTYPE REAL>
18:24:12
phoe
if SBCL can notice that (real -0.5d0 -0.5d0) is a subtype of (not integer) then this case is solved
18:25:24
phoe
I meant that when SBCL has two ranges that have the same exclusive bound, one starting, the other ending
18:25:43
Bike
it doesn't know that (or (real * (-0.5d0)) (real (-0.5d0))) is (and real (not (real -0.5d0 -0.5d0)))
18:26:30
phoe
it can figure it out then! if it has a union ctype with a range type with an exclusive bound, then it can look through all other ctypes in the union type
18:26:59
phoe
if that is true, then it can look for the third ctype - the one that contains that missing point
18:27:15
Bike
that is, it makes a range for real, and then subtracts out the (real -0.5d0 -0.5d0) to get the same union type.
18:28:21
phoe
so it iterates through all remaining ctypes to see if there is one whose *beginning* exclusive bound starts at -0.5d0
18:29:05
Bike
or, presuming it's in the middle of computing a disjunction, it sees if any of the types the exclusive range is being disjoined with includes the missing point.
18:29:10
phoe
so now it iterates through all remaining ctypes to see if there is anything that is a supertype of (real -0.5d0 -0.5d0)
18:39:52
Bike
"This extended subtypep decision procedure would then be NP-complete, since we could use it to do tautology-testing." right
18:41:04
phoe
or are they treated as blobs that can return arbitrary results and are therefore unpredictable until the first result is cached in?
18:42:02
Bike
and it can know that (or (satisfies foo) (not (satisfies foo))) is T, unless it wants to allow for an even weirder type system
18:44:06
Bike
you'd only run into NIL NIL results when you mix satisfies with normal things like ranges
18:46:28
Bike
really, i'd say rather than fixing this range thing you should figure out why sbcl and ccl are more confident than they oughta be
18:47:21
Bike
right... so what is it specifically? it assumes cons types are never nil or something?
18:48:36
Bike
i wrote an implementation of typecase that tries to be reasonably smart. it's still quite dumb and is already a thousand lines
18:49:13
pfdietz
I use trivia. I had a problem recently where it was taking exponential time to compile patterns.
18:50:50
phoe
the type method for complex equality is at https://github.com/Clozure/ccl/blob/master/level-1/l1-typesys.lisp#L3126
18:53:24
phoe
because we can only bail out and confuse ourselves and we cannot return T T at this point
18:53:24
Bike
and the union is all of cons types, so none of them have type-might-contain-other-types-p.
18:53:58
phoe
because the car-type of the first cons is the hellish T type in disguise that wasn't detected
18:54:13
phoe
hence my reasoning - if we solve this T detection, then this type nicely folds up into a T
18:55:00
phoe
because in this complex-= method, the only thing we can effectively do now is return NIL NIL
18:55:54
phoe
pfdietz has his random subtypep tester, we could possibly adapt it to turn CCL's subtypep into swiss cheese.
18:56:52
phoe
but my opinion is to fix what we have now in CCL with the tools that we have, especially since numeric ranges are actually used and utilized and it is possible that someone will end up with a weird range like this someday.
18:59:20
Bike
(type= (specifier-type '(or (cons (satisfies foo)) (cons (satisfies bar)))) (specifier-type '(cons (not float))))
19:00:32
phoe
(list (specifier-type '(or (cons (satisfies foo)) (cons (satisfies bar)))) (specifier-type '(cons (not float))))
19:00:37
phoe
(#<CONS-CTYPE (CONS (OR (SATISFIES FOO) (SATISFIES BAR)) T)> #<CONS-CTYPE (CONS (NOT FLOAT) T)>)
19:00:44
Bike
ah, hey, if i make the first type (or (cons (satisfies foo) (satisfies foo2)) (cons (satisfies bar) (satisfies bar2))) i get NIL T
19:05:14
Bike
seems to me like it should just give up and return NIL NIL unconditionally, or at least return it more than it does now.
19:12:50
phoe
#| even though I quietly hoped that your help would reduce the number of open bugs, not increase it |#
19:14:29
jasom
so https://github.com/norvig/paip-lisp/issues/10 being on the front-page of HN reminded me of my attempts to get abcj running in DoppioJVM (a JS JVM impelmentation). It works, but the startup is *very* slow any idea what happens between "Low-level initialization" and "Startup completed"? I'm seeing over 90 seconds spent in that time...
19:19:45
Xach
i don't know the answer, sorry. in my experience abcl is slow to start up directly on my laptop, too, but it's not 90 seconds.
19:21:17
jasom
It's junder 1 second to reach the "Startup completed" message on my workstation and 106 seconds on Firefox, 45 seconds on chromium.
19:32:07
Bike
the (cons :simple-subtypep) method checks both subtypeps, obviously, and gets NIL NIL and T T for my example, respectively.
19:32:54
Bike
probably what it's meant to have is that if one of the inner subtypeps is NIL T, the conses' subtypep is NIL T regardless of the other one.
19:33:36
jasom
heh, I just ran the boyer test from the gabriel benchmarks (chosen alphabetically). It's ~200 times slower in the browser, so it seems to just be an across-the-board difference in performance between the two JVMs.
19:36:21
phoe
Bike: when you have something postworthy, please post at https://github.com/Clozure/ccl/issues/249 - my brain is unable to comprehend Lisp right now, so please treat anything that you tell me as lost
19:37:09
phoe
I'll be better tomorrow, but today I've been digging into the type system for about eight hours straight
20:07:41
Bike
actually i guess what i actually want is a 4d kmap, except i absolutely don't want that