DailyJS

Scriptjure and JavaScript/Scheme

2009-11-23 00:00:00 +0000 by Alex R. Young

Scriptjure is an interesting project for those of you who like Clojure. It
generates JavaScript like this:

(js (alert "hello world"))
=> "alert(\"hello world\")"

(js (foo x y))
=> "foo(x, y)"

(js (if (== foo 3) (foo x) (bar y)))
=> "if ( (foo == 3) ) {
   foo(x);
   }
   else {
   bar(y);
   }"

Other related projects that are worth looking at are Lisp in
JavaScript
and
Parenscript.

This reminded me of The Little
JavaScripter
which was an
interesting essay by Douglas Crockford, based on The Little LISPer. If
you've heard people saying Scheme and JavaScript are related but aren't
sure what this means, it's worth reading it. Google Books has a viewable
version of The Littler Schemer so you can follow
along.