freenode/#lisp - IRC Chatlog
Search
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
3:23:46
equwal
no-defun-allowed: CL lacks lots of basic functions it would be nice to have. Like today I wanted to compute some permutations, and had to write the code manually (when it could have been a library).
3:31:35
pjb
Strange... (com.informatimago.clext.association::permutations '(1 2 3)) #| --> ((1 2 3) (2 1 3) (2 3 1) (1 3 2) (3 1 2) (3 2 1)) |#
4:46:33
aeth
permutations would be pretty low on my 'nice to have built into a language' list, below regexp, and I rarely use regexp
4:49:48
aeth
but when the hard algorithm for $thing is on Wikipedia and it's not that many lines (incomprehensible lines, but still not many lines)...
6:02:30
ebrasca
loke: For example replace (+ (* x x) (* x x) (* x x)) with (* 3 x x) or someting better.
6:06:18
aeth
and when they're not floats, you still get generic arithmetic unless you can bound the problem because they could become bignums
6:36:02
loke
You have a simplifier function that takes an expression, and simplifies it, such as: ((MTIMES) x x) → ((MEXPT) x)