Very early work-in-progress
Wait, what's wrong with Emscripten?
It's basically Java Applets 2.0.
bonsai-c won't provide a full C implementation from day one. It won't have fancy features like, for example, strings. What it will do is provide a way for programmers to harness the power of asm.js, with a syntax that's as familiar as it gets.
npm install -g jison
Then, from the root of the codebase:
npm install cd c_parser npm run build-parser cd ..
To compile to asm.js:
node bonsai-c.js --asmjs infile.c
To compile to WebAssembly text format:
node bonsai-c.js --wast infile.c
From the root of the codebase:
node ./runtests.js # run all tests node ./runtests.js --asmjs # run asm.js output tests only node ./runtests.js --wast # run WebAssembly text output tests only
To run the
--wast tests, you must be running Node 8.2 or later, and have
wast2wasm from the WABT suite in your path.