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 meta-programming 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 run-time 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 data types. 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 use of JavaScript debuggers.
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.6, came out on February 8, 2016 and can be downloaded here. Older versions can be downloaded from the release directory.

Parenscript is also available via Quicklisp: (ql:quickload :parenscript)

Source repository

https://gitlab.common-lisp.net/parenscript/parenscript.git

Documentation

Tutorials

Mailing Lists

parenscript-devel@common-lisp.net
Mailing list archives and subscription preferences are available at: https://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel

The Parenscript mailing list was briefly hosted at https://groups.google.com/d/forum/parenscript

Contributing

Please send patches and bug reports to the mailing list: parenscript-devel@common-lisp.net

Related Projects

Development Tools

slime-proxy, a hack for proxying a slime connection through a connected lisp and a cross compiler like Parenscript.

trident-mode.el Emacs minor mode for live Parenscript interaction.

Extensions

PSOS (Parenscript Object System) provides CLOS and condition system functionality for Parenscript.

Suave is a set of tools for developing semantic web applications, and includes various extensions to Parenscript.

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 web server includes a web development framework that uses 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.

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 back end 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 3-clause license. Details are contained in the COPYING file, included with the distribution.