3 ms·
> A small and portable Scheme implementation that supports closures, tail calls, first-class continuations, a REPL and AOT and incremental compilers. All that f
by twic 5y ago
> A small and portable Scheme implementation that supports closures, tail calls, first-class continuations, a REPL and AOT and incremental compilers. All that for a run time footprint around 4 KB!
It's portable, but it contains a compiler? For any architecture?
> Currently Ribbit supports the target languages C, JavaScript, Python and Scheme
Aha. So it compiles to another language, and relies on that for portably compiling to a target architecture. Actually pretty sensible!
Well, apart from the last option. Using Scheme to compile this Scheme implementation, written in Scheme, to a Scheme program which you can run on another Scheme implementation is surely just Scheme with extra steps.
Anyway, how does the incremental compiler work with the C target?
- throwaway81523 5y agoIt doesn't compile to C, it compiles on the fly to VM code, and there are implementations of the VM in C, Python, Scheme, and JS. Otherwise the REPL would have to invoke a C compiler. Note that while the code footprint (size of the compiled VM) is only around 4k, the ram usage is much higher. They use a heap size of 200k though smaller would probably still work.