https://github.com/jscl-project/jscl
A Lisp-to-JavaScript compiler bootstrapped from Common Lisp
https://github.com/jscl-project/jscl
common-lisp compiler javascript jscl lisp
Last synced: about 1 month ago
JSON representation
A Lisp-to-JavaScript compiler bootstrapped from Common Lisp
- Host: GitHub
- URL: https://github.com/jscl-project/jscl
- Owner: jscl-project
- License: gpl-3.0
- Created: 2013-01-04T13:27:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-02-04T16:42:08.000Z (3 months ago)
- Last Synced: 2025-03-07T06:20:34.804Z (about 2 months ago)
- Topics: common-lisp, compiler, javascript, jscl, lisp
- Language: Common Lisp
- Homepage: https://jscl-project.github.io
- Size: 3.61 MB
- Stars: 897
- Watchers: 57
- Forks: 110
- Open Issues: 90
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
Awesome Lists containing this project
- curated-awesome-cl - JSCL - A CL-to-JS compiler designed to be self-hosting from day one. Lacks CLOS, format and loop. (REPLs ##)
README
# JSCL
[](https://github.com/jscl-project/jscl/actions/workflows/main.yml)
JSCL is a Common Lisp to JavaScript compiler, which is bootstrapped
from Common Lisp and executed from the browser.## Getting Started
You can try a demo online [here](https://jscl-project.github.io/), or
you can install the JSCL npm package:npm install -g jscl
to run `jscl-repl` in NodeJS.## Build
If you want to hack JSCL, you will have to download the repository
git clone https://github.com/jscl-project/jscl.git
*load* `jscl.lisp` in your Lisp, and call the bootstrap function to
compile the implementation itself:(jscl:bootstrap)
It will generate a `jscl.js` file in the top of the source tree. Now
you can open `jscl.html` in your browser and use it.## Status
JSCL is and will be a subset of Common Lisp. Of course it is far from
complete, but it supports partially most common special operators,
functions and macros. In particular:- Multiple values
- Explicit control transfers
[tagbody](http://www.lispworks.com/documentation/HyperSpec/Body/s_tagbod.htm)
and [go](http://www.lispworks.com/documentation/HyperSpec/Body/s_go.htm)- Static and dynamic non local exit [catch](http://www.lispworks.com/documentation/HyperSpec/Body/s_catch.htm),
[throw](http://www.lispworks.com/documentation/HyperSpec/Body/s_throw.htm);
[block](http://www.lispworks.com/documentation/HyperSpec/Body/s_block.htm),
[return-from](http://www.lispworks.com/documentation/HyperSpec/Body/s_ret_fr.htm).- Lexical and special variables. However, declare expressions are
missing, but you can *proclaim* special variables.- Optional and keyword arguments
- SETF places
- Packages
- The `LOOP` macro
- CLOS
- Others
The compiler is very verbose, some simple optimizations or
*minification* could help to deal with it.Most of the above features are incomplete. The major features that are still missing are:
- The `format` function
*Feel free to hack it yourself*