Message from JavaScript discussions

December 2018

β€” 

process.stdin.on("data", code => {
const hzModule = new Function(
"hzUserLib",
"return " + hzCompile("(function (){" + code.toString() + "})", false, false, true) + ";"
);
hzDisp.import(hzModule);
hzDisp.runAsync(30);
});

Message permanent page

β€” 

hzCompile is a magical compiler pipeline that makes the code interruptible, and hzDisp is the runtime... called with runAsync(30) it schedules a chunk of the code in the regular JS event loop every 30ms, meaning other things which are scheduled in the loop (like the REPL input) can work every 30ms or so

β€” You mean, you can control execution pressing buttons in the console?🀀

β€” You could if I added the buttons

β€” I mean keyboard buttons🀀

β€” Ahh no

β€” There is no code stepping yet

β€” I need to do source mapping first

β€” The compiled code is quite hard to read

β€” Compiled: https://bin.mkr.pw/~5c126bc6e71eb861d3e3d6ff

β€” Original: https://github.com/Floofies/hertzscript-compiler/blob/master/examples/statues.js

β€” Also, the stepping is between yields in the code