ribbit
hedgehog
ribbit | hedgehog | |
---|---|---|
16 | 3 | |
429 | 95 | |
0.9% | - | |
5.0 | 10.0 | |
6 days ago | over 10 years ago | |
Scheme | C | |
BSD 3-clause "New" or "Revised" License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ribbit
- Rabbit Scheme Compiler
-
Microcontroller-based Lisp machine (minimum language needed)?
Marc Feeley's lab develops Ribbit Scheme, which is a tiny Scheme implementation. It is an AOT compile which produces a string of bytecode that is interpreted by a VM, of which there are various implementations. The one in C could be compiled to your target microcontroller and thus give you a Scheme REPL.
-
Use case for Ribbit Scheme
I have a question regarding Ribbit Scheme. (https://github.com/udem-dlteam/ribbit).
-
Advice for a Haskeller who wants to learn Scheme?
You might want to look at this 400 LOC implementation of Scheme in Haskell: https://github.com/udem-dlteam/ribbit/blob/main/src/host/hs/rvm.hs
-
Some benchmarking of various Ribbit hosts
Ribbit is a very interesting minimal Scheme driven by Marc Feeley. I spent a bit of time to benchmark some of the target runtimes and the results might be of interest to some.
- Ribbit Scheme bootstraps with Posix shell while supporting TCO, call/cc and GC
-
Most readable Scheme implementation
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! https://github.com/udem-dlteam/ribbit
-
Analysis of the overhead of a minimal Zig program
> No dynamic memory allocation = no garbage collector, no non-deterministic allocation/deallocation, no write barriers, no out-of-memory possibilities, no fragmentation. For a surprisingly large class of programs, this is a great situation!
I know you know this already, but your statement is a little too broad. Those problems all still exist, but are greatly reduced. Data structures still need to be compacted, caches evicted, scratch space cleared, etc. It is just that one class of intractable issues gets removed when dynamic memory allocation goes away.
On a side note, have you seen this? https://github.com/udem-dlteam/ribbit
-
State of Scheme to Javascript (in 2021) - A shallow overview of a couple of the node/browser compatible scheme implementations.
You should also mention the JS version of Ribbit Scheme which supports tail-calls, continuations, a REPL, an AOT and incremental compilers, and a 4K run time footprint. There are also C, Python and Scheme versions of the Ribbit VM (more to come!). Demo: https://udem-dlteam.github.io/ribbit/repl-max-tc.html Repo: https://github.com/udem-dlteam/ribbit Paper: http://www.iro.umontreal.ca/\~feeley/papers/YvonFeeleyVMIL21.pdf Clearly Ribbit has fewer features than Gambit to achieve a 4K footprint. Gambit (700K footprint) offers a better development environment, in particular precise error messages and live debugging with a REPL in the browser. Gambit also has: - R7RS conformance including R7RS modules - a JavaScript FFI that supports asynchronous calls between JS and Scheme - a thread system build on top of first-class continuations - serializable closures and continuations allowing task migration - access to files on the server using Scheme file I/O - Scheme to JS compilation for fast execution
- A small Scheme implementation with AOT and incremental compilers that fits in 4K
hedgehog
-
Bytecode interpreters for tiny computers (2007)
That is cool, it looks like Python, how did they get it so small? Is it garbage collected? Is the interpreter entirely resident in the Arduino or does it rely on an external communication app hosting the compiler? That approach is actually underutilized in my opinion.
I gotta say that AVR Arduino hardware is almost silly by now. The Raspberry Pi Pico is probably the successor basic MCU board these days. It costs $4 retail, and has a dual ARM M0+ cpu with 264KB of ram and 2MB of SPI flash, so it can run Micropython and other relatively full featured software.
Also check out my old favorite Hedgehog Lisp: https://github.com/sbp/hedgehog
It's a functional-style Lisp dialect whose VM is 20K bytes. It uses an external ahead-of-time compiler, no resident interpreter.
-
uLisp on the Raspberry Pi Pico
Ulisp is cute but (when I looked at it a while back) way too limited and inefficient. My favourite Lisp of this type is Hedgehog, which should run very nicely on a Pi Pico. Its main drawback is it has no REPL, but instead uses a separate byte-compiler that for some reason is written in C.
https://github.com/sbp/hedgehog
-
A small scheme VM, compiler, and REPL in 4k
The 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.
> I would like to have seen Hedgehog Lisp ( https://github.com/sbp/hedgehog ) in the comparison chart, since it has actually been used for practical projects
Links to projects?
What are some alternatives?
gambit - Gambit is an efficient implementation of the Scheme programming language.
spry - A Smalltalk and Rebol inspired language implemented as an AST interpreter in Nim
STklos - STklos Scheme
selda - A type-safe, high-level SQL library for Haskell
scheme-for-max - Max/MSP external for scripting and live coding Max with s7 Scheme Lisp
racket - The Racket repository
hasql - The fastest PostgreSQL libpq-based driver for Haskell
duckduckgo-locales - Translation files for <a href="https://duckduckgo.com"> </a>
postgrest - REST API for any Postgres database
javafx-gradle-plugin - Gradle plugin that makes it easy to work with JavaFX 11+
musl-libc - Musl-libc copy git://git.musl-libc.org/musl