Tiny Scheme interpreters

Tiny Scheme interpreters

There are numerous small Lisp/Scheme implementations, and probably most of them are unfinished or unmaintained. I found serious, production-ready tiny Scheme interpreters for you to embed in your C or C++ programs.

TinyScheme

TinyScheme is notable for being used by Apple in their operating systems and by GIMP for its scripting language. The latest version is around 5 thousand lines of C plus ~500 lines of Scheme. TinyScheme is easy to embed into C projects, and it has a pretty easy to use API.

Website: http://tinyscheme.sourceforge.net/home.html
License: 3-clause BSD-like

s7

s7, developed for Snd sound editor as an extension language, was based on TinyScheme, but diverged from it, and now supports much more features. It is compatible with R5RS and R7RS.

It has continuations, ratios, complex numbers, macros, keywords, hash-tables, multiprecision arithmetic, generalized set!, unicode, and so on. It does not have syntax-rules or any of its friends, and it does not think there is any such thing as an inexact integer.

s7 Scheme also has a good C API (I think it’s an improvement on what TinyScheme had to offer). It is much larger than TinyScheme: ~60K lines of C (two-megabyte s7.c file!), and ~83K lines of Scheme (a lot of it is optional, though). Hey, it’s not that tiny anymore, actually!

Website: https://ccrma.stanford.edu/software/snd/snd/s7.html
Download: ftp://ccrma-ftp.stanford.edu/pub/Lisp/s7.tar.gz
License: 3-clause BSD-like

Chibi-Scheme

Chibi-Scheme is the newer implementation, and one of the first Scheme implementations to support R7RS (its author, Alex Shinn, was in the R7RS working group). It has a fast, optimized VM with precise garbage collector. Multiple Chibi VMs can run on separate OS threads.

Chibi is around 15K lines of C with ~25K lines of Scheme, a lot of which is optional. According to the author, TinyScheme, which is mentioned above, is very slow, and one of Chibi-Scheme’s goal, in addition to being small, is to be fast.

Sources: https://code.google.com/p/chibi-scheme/
Manual: http://synthcode.com/scheme/chibi/
License: 3-clause BSD-like

Leave a Reply

Your email address will not be published. Required fields are marked *