Step 1: Include js-lisp
Include the js-lisp code (lisp.js inside /build/).
Step 2: Include your lisp code
The functions, macros, and variables created for the lisp environment are documented in /docs/. They are also up on the live demo: http://williambowers.net/projects/js-lisp/docs/.
New documentation can be created by running
Playing around at the REPL
You can play around with the repl here: http://williambowers.net/projects/js-lisp/examples/repl/.
The REPL is located at /examples/repl/ (follow the steps under the section "How do I view the tests and html documentation?" to start a simple webserver at the root of the project), and works just like any other REPL. The console emulator is a modified version of jquery-console.
Here are a few shots of the REPL, and js-lisp, in action:
Command line REPL
There's also a command line version of the REPL written in node.js at /examples/noderepl/. You can run it like this (you must be inside the /examples/noderepl/ directory):
$ node run.js
And I suggest using rlwrap (for readline support):
$ rlwrap node run.js # or $ rlwrap ./noderepl
What lisp are you using?
Which files do I use?
Unless you want to make modifications to js-lisp, the files you care about are:
How do I view the tests and html documentation?
This project comes with a little helper script that runs a SimpleHTTPServer (Python) at the project root, displaying the main html page of the project's documentation.
The web server makes available the test suite, documentation, and all of the examples contained within this project.
First thing, make sure you init and update the submodules after cloning this project:
git submodule init git submodule update
Next, you'll need to install rake in order to run the command that starts the webserver:
gem install rake
Now start the server:
The webserver will be located at localhost:8000 (or 127.0.0.1:8000 if that doesn't work).
If you're feeling adventurous enough to modify js-lisp, there's one specific rake command you'll want to run:
rake watch will run a program that automatically builds the project when there are modifications anywhere under the /src/ directory. This will make development go much faster for you.
If you feel like building the project manually, its
and for the minified version:
You said js-lisp is so buggy I shouldn't use it in production code. What gives?
Ok, you misunderstood me. js-lisp is young. Really young. Having said that, it works. Pretty well actually. It's also got a pretty solid test suite, with a lot of code coverage. On top of that, 99% of the test code is actually written in lisp and interpreted by js-lisp. So use it. Do awesome things with it. Share it with your friends. Share what you're doing with me. Just don't use it in production code. js-lisp is not stable, and I guarantee you that your users would find all the bugs I haven't found yet. And be mad at you.
The following is a list of browsers where all of the examples worked and all of the tests passed, the last time that browser was checked.
OS X Snow Leopard
- Chrome 5 (first stable mac release)
- Safari 4
- Firefox 3.5
- Chrome 5
- Firefox 3.5
- Chrome 5
- Firefox 3.7 (nightly)