r/lisp • u/Feisty_Bike_9614 • Oct 21 '26
Scheme New scheme compiler in rust
I’ve completed a new scheme R7RS-small compiler with optional JIT support . It is written purely in rust and has a rust api for embedding in rust programs but also has a standalone repl ( with completion, history etc ) . There is an included eMacs package that supports a small subset of slime behavior via tcp.
The disclaimer is that this was written using agentic programming ( fable and opus ) over a one week period. My project is a new rendering and modeling system but I needed an embedded language with specific requirements so I chose scheme after evaluation of 5 or 6 alternatives.
It mainly has been tested on macOS but should run on Linux . ( I’ll do more Linux testing as I get time )
github.com/k2msmith-gfx/scm
Update: have made some improvements to the collector which improves performance on average by about 1.5x over previous version. On average about 2x faster than steel . In comparison to CPython, it’s about 2.5X slower ( interpreted bytecode version) . It’s a larger project to match python speed but doable . In my use case , the speed would not improve much but for a general use implementation where fast numerical loops are important it would . I won’t add it unless someone else wants to use it . If anyone is interested in using the beautiful and fast zed editor , I’ve made a plugin for that that supports a subset of slime + repl with this scheme.
5
u/a1b4fd Oct 21 '26
It's an interpreter though? Not a compiler
6
u/Baridian λ Oct 21 '26
What’s the point if you don’t even have full call/cc or rationals?
Why even share this if you put no effort in and anyone else could duplicate your lack of effort?
3
u/arvyy Oct 22 '26
I don't really see a reason why you wanted to share this. Very unlikely anyone will use it except you
1
u/Trader-One Oct 21 '26
why you do not compile scheme to rust or to other binary format/language.
For JIT you need executable stack/heap and it needs requesting waiver in regulated environments.
1
u/Hopeful_Technology97 25d ago