INPUT

OUTPUT



I wanted to get a feel for just how powerful JavaScript is as a programming language (as opposed to just a scripting language), so I sat down one evening and wrote this. It turns out that it was quite good for this application, since it is so flexible - dynamically sized arrays are used throughout, and associative arrays make the symbol table quite easy.

A number of Lisp instructions are implemented (see below). The choice of instructions and some of the implementations of the composite functions were taken from Roger Rohrbach's Lisp in Awk interpreter. The syntax is standard, and only integer arithmetic is available. Primarily because it is easy to implement, scoping is dynamic as in original Lisp and unlike modern Lisp or Scheme.

Since this is pretty much a toy, it doesn't do much in the way of error handling. However, it should work on correct Lisp code; if it breaks on code you believe to be correct, please send me mail.

To see the source code, just View-Source on this page; but see the copying restrictions below.

Update 2010:

I wrote this in 1997, just for fun and as a vehicle for learning JavaScript. It's just a toy, and at this point a rather outdated toy at that. People are still welcome to send bug reports, but know that in all likelihood I'm not going to fix the bugs you report.

Meanwhile, there are a few other Lisps in JavaScript that might interest you: