A small Scheme implementation with AOT and incremental compilers that fits in 4K(github.com)
github.com
A small Scheme implementation with AOT and incremental compilers that fits in 4K
https://github.com/udem-dlteam/ribbit
30 コメント
AOT - Ahead of Time compilation
When claiming it's a scheme, they should also state which version they are aiming at. From the readme, this seems to be a partial implementation of R4RS? Is this correct?
I wonder how this would change if they wanted to optimize for total memory usage or runtime memory usage. Many of their target use cases (e.g. embedded) have more flash memory than ram.
Does anyone know of scheme (or other) such interpreters that better in that respect?
Does anyone know of scheme (or other) such interpreters that better in that respect?
Search for
picbit scheme
in Google.Nice to see some AOT love for Scheme, and not yet another interpreter.
Earlier thread: https://news.ycombinator.com/item?id=29348033
lovelyviking(2)
Marc Feeley of Gambit Scheme is one of the contributors. And the compiler is in plain Scheme itself, so can be executed from Guile, Chicken and Gambit. Very interesting.
And as for the origin on the Chicken Scheme name, it is mentioned here: https://news.ycombinator.com/item?id=9323673
And as for the origin on the Chicken Scheme name, it is mentioned here: https://news.ycombinator.com/item?id=9323673
> 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?
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?
It 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.