From 0c75fd67e3fcfbfb09d8c11b6cf396084ce40a15 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 10 Mar 2021 10:32:30 -0400 Subject: Wrestling with JPHP. --- lux-js/commands.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lux-js/commands.md (limited to 'lux-js/commands.md') diff --git a/lux-js/commands.md b/lux-js/commands.md new file mode 100644 index 000000000..ff0124850 --- /dev/null +++ b/lux-js/commands.md @@ -0,0 +1,45 @@ +# JavaScript compiler + +## Test + +``` +cd ~/lux/lux-js/ && lein lux auto test +cd ~/lux/lux-js/ && lein clean && lein lux auto test +``` + +## Build + +``` +cd ~/lux/lux-js/ && lein lux auto build +cd ~/lux/lux-js/ && lein clean && lein lux auto build + +## Build JVM-based compiler +cd ~/lux/lux-js/ \ +&& lein clean \ +&& lein lux build \ +&& mv target/program.jar jvm_based_compiler.jar + +## Use JVM-based compiler to produce a JS/Node-based compiler. +cd ~/lux/lux-js/ \ +&& lein clean \ +&& time java -jar jvm_based_compiler.jar build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program \ +&& mv target/program.js node_based_compiler.js + +## Use JS/Node-based compiler to produce another JS/Node-based compiler. +cd ~/lux/lux-js/ \ +&& lein clean \ +&& time node --stack_size=8192 node_based_compiler.js build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program \ +&& mv target/program.js lux.js +``` + +## Try + +``` +## Compile Lux's Standard Library's tests using a JS/Node-based compiler. +cd ~/lux/stdlib/ \ +&& lein clean \ +&& time node --stack_size=8192 ~/lux/lux-js/lux.js build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux + +node ~/lux/stdlib/target/program.js +``` + -- cgit v1.2.3