Parenscript

A small Lispy language that can be compiled to JavaScript

Introduction

Parenscript is a translator from a small Lispy language to JavaScript. The language understood by the Parenscript translator is mostly a subset of Common Lisp, and Parenscript code itself can run almost identically on both the browser (as JavaScript) and server (as Common Lisp) sides.

Because Parenscript code is treated the same way as Common Lisp code, the full power of Lisp macros is available to the developer, with the added flexibility that macros can either be shared between CL and PS, or have different expansions in either environment to enable the same application code to accomodate differences between browser and server. Due to this ability and the tremendous code-generating power of Lisp, Parenscript 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 strives to produce maximally readable JavaScript with the absolute minimum performance 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 zero-effort integration with JavaScript libraries such as Prototype.

Download

The latest Parenscript tarball release is as of February 16, 2009, and can be downloaded here. Older versions can be downloaded from the release directory.

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

Thanks to Luca Capello, users of the Debian GNU/Linux system can install the cl-parenscript Debian package by typing the following:

apt-get install cl-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 web development framework. This project was forked off of that effort, and UCW continues to maintain an older version of the codebase.

The Weblocks framework also 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.

Project members

Parenscript is currently maintained by Vladimir Sedach and Travis Cross. 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.