Javascript Lisp Interpreter
(or press Shift+Enter)
If you don't already know Lisp these are some good starting places:
Other Javascript Lisp Interpreters to check out:
Copyright Stuff
I copied some of the functions defined in lisp from Joe Ganley's page: Portions copyright © 1997-2006 Joe Ganley.
And also checked out Marc Belmont's implementation: Portions copyright © 2005 Marc Belmont
And was influenced by various stuff written by Paul Graham as well: http://www.paulgraham.com
I copied some of the functions defined in lisp from Joe Ganley's page: Portions copyright © 1997-2006 Joe Ganley.
And also checked out Marc Belmont's implementation: Portions copyright © 2005 Marc Belmont
And was influenced by various stuff written by Paul Graham as well: http://www.paulgraham.com
Using the Interpreter
This interpreter currently understands a reasonable subset of the Common Lisp dialect. Currently implemented primitives include:
- quote (aliased as ')
- atom
- numberp
- +
- -
- *
- /
- <
- <=
- >
- >=
- =
- eq
- and
- or
- car
- cdr
- c[ad]+r
- cons
- list
- cond
- lambda
- defun (aliased as define)
- let
- set
- eval
There are a also a handful of "helper" functions defined in lisp that are included:
- null
- not
- if
- append
- pair
- assoc
- maplist
- len
- flatten
- equal
- append
- member
- last
- reverse
- remove
You can embed this interpreter in a page by adding the following in your <head> tag:
<script src="http://www.synapticfailure.com/ai/lisp_js/lisp.js"></script> <script>Lisp.runScriptsOnPage();</script>
And then adding your embedded lisp code in script tags with a type of "application/lisp":
<script type="application/lisp">"Hello World"</script> <script type="application/lisp">(+ 1 3)</script>
For example:
I'm still working on this off and on for fun so other features should be
added as I get around to it. If there's something you'd like to see
added please feel free to let me know.
I also have a node cli wrapper available on github.