Jisp - a dialect of Lisp in JavaScript

Brian Morearty
May 10, 2006 (with major additions July, 2007)

Jisp is a new dialect of Lisp that I invented.

I realized that JavaScript has so many similarities with Lisp that it would be easy to write a JavaScript-based Lisp language that uses the browser's JavaScript parser rather than writing my own parser. It turned out to be even easier than I expected--it took me an evening to create the basic language. (It's not a complete Lisp implementation, of course.) It looks a little different from most Lisp dialects. (Uses brackets instead of parentheses and uses commas between list elements) because of its basis in JavaScript.

Here is a sample Jisp expression that adds two numbers. This expression does not have side-effects (such as UI output)--it just returns a result:

  [plus, 7, 3]


I have tested it in IE6, IE7, and Firefox 1.5 and 2.0.

To evaluate a Jisp expression or sequence of expressions, call the jisp() function from JavaScript. Here are some more samples.