LispScript

LispScript is a Common Lisp program that translates Lisp programs into Javascript. It's extremely simple at the moment, but has support for basic arithmetic functions, defun, IF, macros, and LET. It currently works with CLISP.

Using LispScript

From the lispscript directory, load CLISP, and type:

> (load "package.lisp")

This will load the lispscript package. To compile the example program, type:

> (in-package lispscript) > (jscompile "test.lisp" "out.js")

This will produce a file called "out.js" which is referenced in the included index.html file. Load index.html in your favorite browser and you'll see a number of alerts with the results of called functions. Clicking on the Test link will show you closures working.

Why?

While I think Javascript is a great scripting language, its scoping and the way it provides closures annoys me, and I really miss macros and LET. So I started doing this to see if I could fix those problems. But really, this is a fun project I work on when I'm bored and have some free minutes to spare, two conditions which seldom occur simultaneously these days.

Obviously, a lot more work needs to be done for this to actually be useful for writing web sites. Contributions are very welcome.