A command-line utility to convert Common Lisp to JavaScript with Parenscript.
- Either Common Lisp implementation
- SBCL (default)
- Clozure CL
- Armed Bear CL
- Parenscript
- cl-portable
- cl-yautils
Our build script for Unix and build.bat for Windows script will download and install Parenscript, cl-portable and cl-yautils automatically. Hence, you don't need to manage dependency by yourself.
Compile and package cl2js
with SBCL:
$ ./scripts/package
or
$ ./scripts/package sbcl
Alternatively, compile and package cl2js
with Clozure CL:
$ ./scripts/package ccl
Uncompress cl2js.tar.gz to some path and add path\to\cl2js\bin to PATH variable. Keep the structure of cl2js directory intact.
Compile and package cl2js
with SBCL:
> .\scripts\package.bat
or
> .\scripts\package.bat sbcl
Alternatively, compile and package cl2js
with Clozure CL:
> .\scripts\package.bat ccl
Uncompress cl2js.zip to some path and add path\to\cl2js\bin to PATH variable. Keep the structure of cl2js directory intact.
You may also run jcl2js
on Unix or jcl2js.bat
on Windows as-is.
To use jcl2js
, add the local path of this repo to PATH variable.
Note: It's cl2js.exe on Windows.
Assume source.lisp is a valid Parenscript source.
Compile source.lisp to output.js:
$ cl2js source.lisp > output.js
Later, run output.js with Node.js:
$ node output.js
Run source.lisp with Node.js on-the-fly:
$ cl2js source.lisp | node
Note: It's jcl2js.bat on Windows.
On first run, jcl2js
will install Parenscript automatically for you:
$ jcl2js
Later, run jcl2js
to compile source.lisp:
$ jcl2js source.lisp > output.js
- Armed Bear CL starts too slowly to be useful as a scripting language
The version of Armed Bear CL bundled in this repo is 1.8.0.
Copyright (c) 2020 Michelle Chen. Licensed under MIT