For users of node.js,
bin/ljc is provided.
For users of SpiderMonkey
js shell, the compiler can be invoked with:
$ js ljc.js
in the src/ directory.
This is an experimental version of LLJS that compiles to asm.js. Not everything is working yet, and dynamic allocation isn't implemented yet, but it will be soon. See this blog post.
To run the asm.js tests, run
make asmtest. To run the benchmark, run
make asmbench. You can see the working examples in the
You might need to define the SPIDERMONKEY_ENGINE and V8_ENGINE environment variables to run the tests (they default to
node respectively). You will also need to define SPIDERMONKEY_ENGINE_NOASM to point to a version of SpiderMonkey without asm.js if you want to run the benchmarks.
If you would like to compile with support for memory checking (detects leaks, accesses of unallocated and undefined memory locations, and double frees) then compile with the -m flag:
$ bin/ljc -m -o myscript.js myscript.ljs
And add the following code to the end of your program run to report any memory errors:
let m = require('memory'); // for SpiderMonkey do // let m = load('memory.js') console.log(m.memcheck.report());
The memory checker uses Proxies so if you use node.js you need to enable it with:
$ node --harmony-proxies myscript.js
To run the tests install the Mocha module then run:
export NODE_PATH=src/ mocha --compilers ljs:ljc
from the root LLJS directory.