4 ms·
This is good, I had been searching for a decent little lisp like this for a while but most of the ones I found had garbage collector bugs (extremely difficult t
by rain1 8y ago
This is good, I had been searching for a decent little lisp like this for a while but most of the ones I found had garbage collector bugs (extremely difficult to locate and fix) or didn't properly implement tail calls. I ended up writing my own https://github.com/rain-1/single_cream https://github.com/rain-1/single_cream but now there's a few solid ones!
Kilo lisp is just over 1000 lines of code, pretty impressive given what it does. It uses the parallel rails memory representation for pairs as taught in sicp. It even seems to be able to load and save "images"!
I'm not totally sure how the evaluator works. It uses these kinds of opcodes? enum { MHALT = 0, MEXPR, MLIST, MBETA, MRETN, MAPPL, MPRED, MNOTP,
MSETQ, MPROG }; do they represent the control stack or something?
- nils-m-holm 8y agoNice to see Kilo LISP pop up here! :) Yes, it does use images. (SUSPEND 'NAME) creates an image file and KL NAME at the shell prompt will load the image. The evaluator is basically multiple functions in one, where the variable "m" ("mode") controls which function to apply next. The codes (MHALT, MEXPR, etc) denote the functions. MEXPR means "evaluate any expression", MLIST evaluates the next element of a list, MBETA starts function application, MRETN finishes it, etc. Yes, they implement states on the control stack (mstack).
- TY 8y agoGood to see you back online, Nils. Your books are amazing - thank you.
- nils-m-holm 8y agoThank you!