An R5RS Scheme in JavaScript.
Puppet Scheme Pascal JavaScript CSS Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



FoxScheme is a Scheme interpreter written in JavaScript.

Some key points include:

  * Proper support for recursion
    FoxScheme does not use the native JavaScript stack, which is often too
    small for interesting recursive problems.

  * Minimal native (primitive) procedures
    Only procedures that must be implemented in JS out of necessity (cons) or
    obvious performance reasons (expt) are native. The rest is expected to be
    implemented in pure Scheme, which means fewer errors in native code.
  * Cleanliness and clarity
    FoxScheme is split into many discrete files, each being reasonably
    self-contained. The code attempts to be easily-readable where possible, and
    commented where not, allowing for easy modification and extension.
  * Self-containod
    FoxScheme tries to minimize its external dependencies, and does not rely on
    external libraries such as jQuery or Prototype.js. FoxScheme does its best
    not to pollute the global namespace or otherwise interfere with other JS
    software. There is no dependence on a browser; for example, early
    development was done using Rhino. This makes FoxScheme easy to embed in a
    web page.
  * Error-checking
    FoxScheme attempts to error-check as much of the user input as is
    reasonable. Many JS Schemes happily accept invalid syntax and other invalid
    input, which can be confusing to the user.

  * Unit testing
    FoxScheme has a growing unit-test suite using JSSpec that is run after
    every atomic change to the codebase.

Known issues:
  * No arithmetic stack
    All numeric computation is done with JavaScript numbers, although bignum
    suppert could be added later.
  * Incomplete
    Currently, only a few native procedures are implemented for things like
    pairs, strings, vectors, and other basic values. There is currently no
    support for modules, macros, and so on. Stay tuned.


    Eric Jiang <>

Acknowledgements and References:

    Special thanks to Adam Foltzer and the people who frequent #scheme on
    FreeNode. BiwaScheme, by Yutaka Hara and the other BiwaScheme contributors,
    was an important inspiration and reference. Kent Dybvig's Petite Chez Scheme
    system and his assorted papers have been tremendously helpful. Also notable
    are Alex Yakovlev's jsScheme, Mark Probst's JScreme, and Jason Orendorff's
    Try Scheme, although no code from them was ultimately used. And, of course,
    The nice web-based REPL is Chris Done's jQuery Console.

  * #scheme on FreeNode

  * BiwaScheme

  * Chez Scheme

  * R. Kent Dybvig

  * jsScheme

  * JScreme

  * Try Scheme

  * jQuery Console