5 ms·
Paper is acm-walled but code repo is https://github.com/udem-dlteam/ribbit https://github.com/udem-dlteam/ribbit . I would like to have seen Hedgehog Lisp ( ht
by throwaway81523 5y ago
Paper is acm-walled but code repo is https://github.com/udem-dlteam/ribbit https://github.com/udem-dlteam/ribbit . I would like to have seen Hedgehog Lisp ( https://github.com/sbp/hedgehog https://github.com/sbp/hedgehog ) in the comparison chart, since it has actually been used for practical projects. Its VM is around 20KB of object code. 4KB is impressively tiny, but any machine where 4k vs 20k makes a big difference is unlikely to have enough ram to run garbage collected applications. That seems to call more something more like Forth rather than Scheme.
Hedgehog is a somewhat weird functional dialect of Lisp and I've been wanting for a while to convert it to a Scheme subset (mostly just using Scheme syntax instead of defun, etc) so people would be more familiar with it.
Added: paper is here http://www.iro.umontreal.ca/~feeley/papers/YvonFeeleyVMIL21.pdf http://www.iro.umontreal.ca/~feeley/papers/YvonFeeleyVMIL21....
- deleted 5y ago[deleted]
- rcarmo 5y agoAdded to https://taoofmac.com/space/dev/lisp https://taoofmac.com/space/dev/lisp along with a few others, since I'm fascinated by this kind of thing.
- feeley 5y agoIn your list you say "small and portable Scheme implementation with AOT compilation and 4K footprint". However the presence of an AOT compiler is not the most interesting part. The distinguishing feature is that in 4K there is a REPL that uses a dynamic compiler to do the "eval". In other words, the code entered at the REPL runs essentially as fast as if it was compiled by the AOT compiler.
- throwaway81523 5y agoIt seems to me (granted I haven't gotten it to work reliably at all yet) that the REPL is somewhat fragile, and I wonder if it might be easier as well as smaller to use a remote (tethered) compiler, as some Forth systems do. Re the repl, I may have figured out what went wrong with user-defined functions. Instead of saying (define (sq x) (* x x)) I apparently have to say (define sq (lambda (x) (* x x))). Maybe that is documented in the paper, which I still have to read.
- bsder 5y agoThe rib encoding looks very clever. I need to digest the full implications of that. > 4KB is impressively tiny, but any machine where 4k vs 20k makes a big difference is unlikely to have enough ram to run garbage collected applications. Yeah, the paper itself says that the heap was 240K. A 4K system isn't very helpful if your heap is 240K. I'd like to see how this runs (if at all) with a 4K heap. Deceptively straightforward things like map and apply can cons up a whopping amount of intermediate garbage. > I would like to have seen Hedgehog Lisp ( https://github.com/sbp/hedgehog https://github.com/sbp/hedgehog ) in the comparison chart, since it has actually been used for practical projects Links to projects?
- djwatson24 5y agoI agree the optimization looks backwards to me - in most of the microcontrollers I work on, the flash program space can easily be multiple megabytes, but the ram is usually the limiter around 128-512k.
- feeley 5y agoThe introduction in the paper explains the motivation for Ribbit: The use case which has motivated our work is code mobility where an executable program can be embedded in a document, email, or website. In that use case the size of the program must be small to minimize the transmission or loading time or to satisfy space constraints, such as the size of a disk boot sector, the URL length limit and the UDP packet size. On the other hand, the space used while the program is executing is of secondary importance. So the main target application is not microcontrollers, even if it can obviously be used for some microcontrollers (for example a 1-2$ ESP32-C3 has 400 KB of RAM). One of the possible applications of Ribbit is to implement the RVM (Ribbit VM) in the Excel spreadsheet formula language (which will soon be turing-complete with the addition of the LAMBDA form) to be able to program spreadsheets in Scheme. The execution environment has lots and lots of RAM, but you want the .xls file itself (which contains the RVM) to be as small as possible so it can easily be sent in emails, etc.
- pumanoir 5y ago