A Lisp-to-Javascript compiler bootstrapped from Common Lisp
Common Lisp JavaScript Other
Clone or download
davazp Merge pull request #321 from equwal/master
(constantp nil) should return t
Latest commit ab07bf6 Jul 16, 2018
Permalink
Failed to load latest commit information.
logo Add JSCL logo (#274) Apr 30, 2017
repl-node stream.lisp uses def!struct Apr 19, 2018
repl-web put back register matching May 9, 2018
src fixed the typo Jul 16, 2018
tests fix for bug in reduce when only one element is in the sequence May 4, 2018
.gitignore ignore CCL fasl files Mar 1, 2016
.mailmap Add an extra author mapping Jan 26, 2017
.travis.yml Require sudo May 19, 2015
CHANGELOG.md Add changelog entry for the infinite loop in the service-worker May 8, 2018
COPYING Move source code under src/ Apr 25, 2013
HACKING.org Document implementation of multiple values in the compiler Nov 19, 2017
README.md Add JSCL logo (#274) Apr 30, 2017
jqconsole.min.js Update jqconsole Jun 14, 2014
jquery.js Some dependencies for the REPL Jan 4, 2013
jscl-worker.html Fix SW and Web worker scopes Apr 19, 2018
jscl-worker.js Store an input buffer for each different tab Apr 22, 2018
jscl.html Add support for web workers and write a repl with them Apr 19, 2018
jscl.lisp Add basic support for array fill pointers Apr 21, 2018
make.sh Make build reproducible by implementing SOURCE_DATE_EPOCH env variable May 2, 2018
package.json 0.6.1 May 7, 2018
run-tests.sh Fix execution of tests, regardless the cwd Aug 7, 2016
service-worker.js Store an input buffer for each different tab Apr 22, 2018
style.css Include forgotten CSS file Feb 19, 2014
tests-report.lisp Fix exit status code Nov 6, 2016
tests.html Fix web tests Jan 14, 2016
tests.lisp Uncomment many more passing tests Nov 6, 2016

README.md

JSCL

Build Status

JSCL is a Common Lisp to Javascript compiler, which is bootstrapped from Common Lisp and executed from the browser.

JSCL

Getting Started

You can try a demo online here, 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 tranfers tagbody and go

  • Static and dynamic non local exit catch, throw; block, return-from.

  • 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

  • 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:

Feel free to hack it yourself