Parenscript

Introduction

Parenscript is a translator from an extended subset of Common Lisp to JavaScript. Parenscript code can run almost identically on both the browser (as JavaScript) and server (as Common Lisp).

Parenscript code is treated the same way as Common Lisp code, making the full power of Lisp macros available for JavaScript. This provides a web development environment that is unmatched in its ability to reduce code duplication and provide advanced metaprogramming facilities to web developers.

At the same time, Parenscript is different from almost all other "language X" to JavaScript translators in that it imposes almost no overhead:

No runtime dependencies
Any piece of Parenscript code is runnable as-is. There are no JavaScript files to include.
Native types
Parenscript works entirely with native JavaScript datatypes. There are no new types introduced, and object prototypes are not touched.
Native calling convention
Any JavaScript code can be called without the need for bindings. Likewise, Parenscript can be used to make efficient, self-contained JavaScript libraries.
Readable code
Parenscript generates concise, formatted, idiomatic JavaScript code. Identifier names are preserved. This enables seamless debugging in tools like Firebug.
Efficiency
Parenscript introduces minimal overhead for advanced Common Lisp features. The generated code is almost as fast as hand-written JavaScript.

Download

The latest Parenscript release, version 2.1, came out on February 27, 2010. Older versions can be downloaded from the release directory.

Parenscript is also available via ASDF-Install: (asdf-install:install :parenscript)

Manual

Tutorials

Repository

You'll need git to work with the Parenscript repository. Once you have git installed, you can clone the repository with:

git clone http://common-lisp.net/project/parenscript/git/parenscript

Mailing Lists

Related Projects

Frameworks

Parenscript originated as part of the BKNR web development framework, and is still used there.

Later on Parenscript development moved to the UCW framework. This project was forked off of that effort.

The Weblocks framework also uses Parenscript.

The teepeedee2 webserver includes a web development framework that uses Parenscript.

Extensions

Suave is a set of tools for developing semantic web applications, and includes various extensions to Parenscript, including the Parenscript Object System (PSOS) - an implementation of CLOS for Parenscript.

Libraries based on or complementing Parenscript

css-lite is an s-exp markup for generating CSS, which can generate plain CL or Parenscript code.

CL-JSON, a JSON parser and generator in Common Lisp, makes use of Parenscript.

ST-JSON, a JSON parser and generator that doesn't use Parenscript.

clouchdb, a library for interacting with the JSON document-oriented CouchDb database, uses Parenscript.

uri-template provides URI templates on the server and client side by using Parenscript.

cl-closure-template is a multi-language templating system that uses Parenscript for its JavaScript backend code generation.

Project members

Parenscript is currently maintained by Vladimir Sedach. It was originally written by Manuel Odendahl and Edward Marco Baringer.

License

Parenscript is licensed under the terms of the BSD license. Details are contained within the COPYING file, included with the distribution.

The license was modified to reflect that Manuel Odendahl and Edward Marco Baringer, not the Regents of the University of California, are the authors.