This project is for a scheme interpreter and any applications written in scheme. This is basically a scheme interpreter that meets the r4rs "standard" (almost) with aspirations to meet the r5rs standard. The last part of r5rs that will likely be implemented (if ever) is the macro support. Also, unlike r4rs and r5rs, but like r6rs, this interpreter is case-sensitive. Thus (eq? 'abc 'AbC) => #f.
Current Status
- r4rs: all essential procedures except
- call-with-current-continuation
- r5rs: all non-optional features but but
- char-ready?
- do
- delay and force
- call-with-current-continuation
- values
- call-with-values
- dynamic-wind
- define-syntax
- let-syntax
- letrec-syntax
- syntax-rules
- Enhancements:
- (quit)
- (popen cmd-string)
- Bugs/Limitations
- No proper tail recursion
- No immutability
- No complex numbers
- Exact vs. inexact numbers needs work
- (procedure? 'car) => #t
- eqv? does not distinguish procedures that behave differently
- No compiler
- Ignores excess arguments, rather than reporting an error
The implementation is not the cleanest thing in the world as it's the largest thing I've ever written in Limbo. But it seems to work pretty well for a relatively quick hack. It currently totals about 4000 lines of Limbo code divided into 4 modules:
- cell.b - core cell, pair, and environment routines
- sform.b - functions that implement special forms
- builtin.b - functions that implement built-in procedures
- scheme.b - top-level REPL functions
Some procedures are implemented in scheme, rather than directly as built-in functions. They are located in /lib/scheme/library.scm.