Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
1–10 of 17 posts
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#2Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#3I am not sure if I understand correctly. So this is a scheme running on a scheme. You need e.g. Chicken to compile/minify it and then run it via Gambit.... Why? Why would I do, except of learning puroposes of course, do such thing. I clearly am missing something.
Ribbit is also bootstrapped (it can compile itself). This means that you only need another Scheme system for the initial step of the bootstrap to compile the Ribbit compiler to one of the supported target languages. After this step the Ribbit compiler only needs an implementation of the target language to run. For example, you can use the Gambit interpreter to compile the Ribbit compiler to a POSIX shell script (about 64K bytes). After this is done then you only need a POSIX shell to compile any Scheme program to C, JavaScript, Python, or POSIX shell script.
In its current state the POSIX shell target is mostly a proof of concept to demonstrate that the Ribbit VM is extremely portable. One area of practical use is for bootstrapping compilers for other languages using minimal tools (see the Mes project https://bootstrappable.org/projects/mes.html for bootstrapping gcc to have a reproducible build process for gcc). With Ribbit's POSIX shell target it would be possible to build gcc on any system that has a POSIX shell (without needing other build tools like a C compiler, linker, etc).
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#4I am not sure if I understand correctly. So this is a scheme running on a scheme. You need e.g. Chicken to compile/minify it and then run it via Gambit.... Why? Why would I do, except of learning puroposes of course, do such thing. I clearly am missing something.
You need a Scheme interpreter (Gambit, Chicken or Guile have been tested) to run the Ribbit AOT compiler. The Ribbit AOT compiler will compile a Scheme program to one of the supported target languages: C, JavaScript, Python, Scheme or POSIX shell script. Ribbit has been designed for a small footprint, so the generated target code is quite compact (as small as 2-4 KB for small programs). This is much more compact than…
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#5This is a semantic difference, not an optimization. Turning off optimizations should never cause your program to crash.
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#6I hate to be pedantic here but I see the term TCO thrown around all the time. The Scheme standard requires that unbounded tail call functions can run in constant space. This is a semantic difference, not an optimization. Turning off optimizations should never cause your program to crash.
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#7Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#8the C one has better comments, I imagine that's the reference implementation? https://github.com/udem-dlteam/ribbit/blob/main/src/host/c/r...
Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#9Re: Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
#10the code is very cryptic: for example the go source: https://github.com/udem-dlteam/ribbit/blob/main/src/host/go/... the C one has better comments, I imagine that's the reference implementation? https://github.com/udem-dlteam/ribbit/blob/main/src/host/c/r...