freenode/#lisp - IRC Chatlog
Search
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
20:23:07
mooch2
hey, how would people here feel about me making an irc channel specifically for emulators written in lisp?
20:25:21
Xach
mooch2: i am interested in blog posts about such things but not as much ongoing discussion
20:26:34
phoe
I'd suggest you actually join an emulation channel of sorts since that's the primary objective
20:26:51
phoe
and refer to #lisp or #lispgames for any kind of support or gossip or sharing you might have
20:27:59
mooch2
i wanna be able to talk with people about how to implement blablabla emulator thing in lisp
20:28:07
_death
there have been posts by lispers about emulators, e.g. https://ahefner.livejournal.com/20528.html
20:28:19
PuercoPope
jasom: I wonder how feasible would be to use clasp to compile CL to WebAssembly through LLVM's WebAssembly backend
20:30:06
jasom
PuercoPope: clasp is a maybe, if it uses C++ exceptions for non-local transfers of control. IIRC ECL and CLISP are both a no-go for webassembly due to the way they do non-local control flow transfers.
20:30:11
phoe
mooch2: I'd worry only after and if someone tells you to take your discussion elsewhere
20:31:01
jasom
PuercoPope: does clasp have an interpreter? Last time I checked, LLVM wouldn't run under webassembly so compilation in the browser is also problematic.
20:31:54
mooch2
i'm currently working on a multi-system emulator project if anybody wants to contribute https://gitlab.com/cl-emu
20:32:16
dlowe
seems like the easiest thing to do (which wouldn't be easy) would be to treat wasm as an sbcl backend and cross-compile the works
20:33:53
PuercoPope
jasom: I'm not to familiar with Clasp. Last time I tried building it was last year.
20:37:22
jasom
Really a bytecode targeting lisp coupled with a fast js/webassembly interpreter for the bytecode would probably be best. Webassembly is just not a great target for lisp.
20:38:59
jasom
dlowe: that's probably only marginally easier than getting jscl to be more spec compliant.
20:39:12
mooch2
i also want to create a frontend that can handle any type of system, and change properties of the systems, such as which software it's running, flipping a floppy disk, or changing the cpu in the case of computers
20:40:36
jasom
dlowe: I've yet to find a single example of wasm generating new wasm to be loaded at runtime though.
20:41:54
jasom
phoe: but I think that implies a javascript shim for calling from one wasm linking unit to another (I haven't read the spec closely)
20:42:17
phoe
mooch2: plugins are doable - for instance your cores can be CLOS objects and common functionality can be declared via generic functions, and implemented by defining methods on the GFs.
20:44:14
jasom
phoe, dlowe, basically each compilation in a wasm implementation would require a dlopen() call to get it into the same linear memory space.
20:44:47
phoe
mooch2: you can distribute FASL files if you want to. Source distribution is very much preferable though.
20:44:47
mooch2
i want the frontend to have a gui option for selecting a dll or something to load in and use as a system
20:45:08
mooch2
i mean, i am still going to contribute source, but i don't want to pull in EVERYTHING every time i load the frontend
20:45:20
jasom
mooch2: you can use asdf to generate a bundle if you prefer, but a source-tree is only different from a dll at the file-system level.
20:45:38
jasom
mooch2: see e.g. clack which includes many backends, but only loads a backend when it is used.
20:47:24
mooch2
phoe, yeah, but i want the machine system to have like, the configuration options defined in a structure in that system, and then i'd only load the configuration options if the core is loaded
20:48:00
White_Flame
mooch2: you could still be cycle accurate, and still likely maintain far better speed
20:48:40
phoe
so if you want to be able to configure all cores then you have to load all the DLLs anyway
20:48:59
White_Flame
mooch2: lisp sexprs are a way better codegen than outputting asm instructions in normal dynarecs.
20:49:33
phoe
that is possible, for example by splitting your system into my-emu.nes.config and my-emu.nes.backend
20:49:36
LdBeth
hortiel_: JavaScript these days is like assembly. You may avoid it depends on what kind of tasks you’d like to do
20:49:55
phoe
load only :my-emu.nes.config at startup and use the configuration options that it presents to you
20:50:16
mooch2
White_Flame, except dynarecs rely on pre-decoding the opcodes and then running them all as one big block
20:50:17
phoe
and then when you want to fire up a game then load the heavy machinery in :my-emu.nes.backend that depends on :my-emu.nes.config
20:52:29
White_Flame
mooch2: usually cycle accuracy requiring events between various chips happen in a minority of cycles. Being able to unroll and partially reevaluate instructions can get you better speed in the straightforward portions, and run slow paths when accesses intersect, depending on the architecture
20:53:06
White_Flame
it's an interesting field that since Lisp can do much better codegen, can yield better speed than C-based emulators that have to do everything more interpreted
20:53:53
jasom
White_Flame: many emulators do not hold that the minority of cycles require cycle accuracy because the majority of instructions will access a shared memory bus.
20:55:13
White_Flame
for instance, on a single raster line the more fixed-function chips know what spots are "live". If the CPU's processing within that line touches one of those locations, you break out of the fast path
20:55:15
pjb
mooch2: 1- you can create a new channel just by joining it. You can "lock" it and become op by using freenode bots, I don't know how, read freenode documentation.
20:56:42
LdBeth
mooch2: since you already have a project you can put the channel in your project description
20:56:51
pjb
mooch2: 2- there are a lot of different kinds of emulators and they can be written in CL. It's indeed an interesting subject. It may be interesting to divert their the discussion to a specific channel, when it becomes too loudly, crowding the general discussion in #lisp. So if you expect a lot of traffic specifically about emulators in CL (or in lisp in general), it may be interresting to create this channel.
20:57:43
White_Flame
i have a semi-functional ivory chip emulation, but I need some assistance in debugging
20:58:12
oni-on-ion
mooch2, false. performance, non-consing technique, its very helpful. to each their own, though.
20:58:31
White_Flame
mooch2: I followed the docs, but it goes off into la-la land on bootup execution
20:58:54
mooch2
White_Flame, yeah but you might've made an error in your coding of the info from the docs
20:59:03
White_Flame
so my next step will otherwise be to disassemble and try to figure out what it "should" be doing
21:00:07
White_Flame
and the VLM itself is not documented at all, and has unknown variances from the hardware ivory envrionment
21:02:57
oni-on-ion
more fun to me is to create Fantasy Console. especially with [common] lisp being somewhat halfway there ^_^
21:03:27
White_Flame
most are from illegal sources. they just had sceners rewrite summary docs with the descriptions of their findings of the most critical portions
21:04:07
White_Flame
but yeahh, lots of hardware edge cases would have been experimentally discovered, and not be officially documnted at all
21:04:45
White_Flame
I don't recall a single case of legal trouble around emu devs based on copyrights of leaked docs
21:05:05
phoe
1) emulators were, are, and will be developed despite emulation being a huge grey area, 2) emulation legality is #lispcafe more than #lisp
21:07:15
White_Flame
I need to leave, but using "illegal" docs does not mmake the software illegal at all. The software is fine. Only your possession of the docs might be actionable
21:09:34
pjb
mooch2: if you're interested in lisp X, the first thing to do is to search X on cliki.net !!!
21:10:29
oni-on-ion
i've a feeling that illegal docs would lead to enough suspicion. for example if another company made an exact Tesla clone. but then, RMS at MIT labs ...
21:13:11
mooch2
oni-on-ion, not really, it's still describing the same things you'd find reverse engineering the thing
21:13:24
pjb
mooch2: https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
21:13:53
pjb
mooch2: emulators are not written from dumps of the silicon design, but from the manual describing the processor.
21:14:57
Xach
If you're new here, it is not always clear that you can and should ignore everything pjb writes in any medium.
21:15:40
pjb
mooch2: emulators are written in general BEFORE the hardware is completed, to let software engineer develop the software at the same time the hardware engineers develop the hardware!
21:16:31
phoe
pjb: you are semantically correct but people commonly refering to emulators usually refer to retro-emulators where you already have all the software but lack a physical machine.
21:18:12
oni-on-ion
to take a short tangent, we should have the specs/schematics for all parts in our iphones shouldnt we ?
21:20:03
oni-on-ion
also of course we should be aware of the difference between Emulator and Simulator. i think pjb referred more to Simulator when considering hardware development
21:20:20
oni-on-ion
mooch2, ahh. i was looking at GBA because its awesome. or NDS its bigger brother =)
21:30:35
oni-on-ion
i was helping der group whom ripped/dumped the gamecube eeprom it was fun but lost my cube =) i was a pirate at the time so couldnt tell from there if it were immoral or illegal