« Barbie Key Signings | Main | 30 Inch Dell Monitors Are a Steal »
ParenScript: A Lispy JavaScript Generator
Feedback on my interview with Bruce Johnson on the Google Web Toolkit led to ParenScript, a little language for Lisp that generates JavaScript. From the intro:
ParenScript is a small Lispy language that can be compiled to JavaScript. It also comes with client-side HTML and CSS generation libraries. This approach simplifies the development of web applications by enabling all components of the application to be written in Lisp, so that HTML, CSS and JavaScript code can all be generated with the full power of Lisp and its macros.
At the same time, ParenScript strives to produce maximally readable JavaScript with the absolute minimum overhead for advanced Lisp features, which sets it apart from other JavaScript generation tools. This enables straightforward, surprise-free debugging in tools like Firebug, and painless integration with JavaScript libraries such as Prototype.
From ParenScript
Referenced Mon Nov 12 2007 09:11:03 GMT-0700 (MST)
One neat feature: ParenScript comes with it’s own macro definition form defpsmacro for creating ParenScript macros. A big step forward in user extensibility. Another is it’s SEXP to JSON translation.
Posted by windley on November 12, 2007 9:18 AM



Comment from Matt Smith at November 13, 2007 12:44 PM
Great post this idea is very interesting to me. It seems like a nice way of doing things.
This week, I also came across a similar methodology that uses PHP rather than Lisp, called QCodo. Have any of you heard much about QCodo?
QCodo is interesting, because it would be easier to find a bunch of PHP programmers than it would to find a few Lisp programmers.
Comment from Dimitry Gashinsky at November 21, 2007 2:43 PM
ParenScript is a very nice language and NOT another framework like QCodo. Can QCode compile any algorithm written in some form of PHP code into the JavaScript that performs the same algorithm?
ParenScript allows one to write algorithms without a need to tweak some model and generators.
From excellent ParenScript tutorial:
(ps
(defun foobar (a b)
(return (+ a b))))
The resulting javascript is:
"
function foobar(a, b) {
return a + b;
}
"
Comment from ken at November 22, 2007 7:58 PM
"QCodo is interesting, because it would be easier to find a bunch of PHP programmers than it would to find a few Lisp programmers."
Erik Naggum: "This is one of the most misleading abuses of statistics around."
The original seems dead, but google cache still has it:
I've witnessed this in action, too. Your premise only works if it's actually better for your project to have "a bunch of PHP programmers" than "a few Lisp programmers".
Also, as Dmitry points out, Qcodo doesn't seem to be a full compiler/translator, so even if having "a bunch of PHP programmers" was a good thing, it's not the same. :-)
Comment from mattias at November 23, 2007 9:06 AM
The benefit of GWT is not in enabling to write javascript for the browser in another language like Java. Javascript itself is not *that* bad.
What it really provides, and ParenScript does not, is a GUI library: http://gwt.google.com/samples/KitchenSink/KitchenSink.html
The idea is to allow Systems Application Developers to write web applications without being, or wanting to be a web developer, and never touching html quirks on different browsers. ParenScript makes you still write html & css, GWT allows to create the ajax web pages using a GUI toolkit very similar to Java's Swing.
Leave a comment
I encourage you to leave a comment below. Your email address will not be displayed on Technometria, but allows me to communicate with you directly. Your email address won't be displayed, but will be used to compute a MicroID for your comment.