4 ms·
https://github.com/vmorgulys/crabble/tree/master/js/object/machine https://github.com/vmorgulys/crabble/tree/master/js/object/m... It is far less advanced than
by vmorgulis 11y ago
https://github.com/vmorgulys/crabble/tree/master/js/object/machine https://github.com/vmorgulys/crabble/tree/master/js/object/m...
It is far less advanced than yours. It's inspired by Forth (a mixture of interpret and compile "word"s).
I'm doing that right now:
let print foreign console.log
print "hello"
Every "word" is a function receiving a stack and returning a stack. Whitespace can be replace by a "|".
Each line is evaluated from right to left. Some words are used to change the state of the compiler and the compiler is a state machine (words are events).
The game is to find a minimal set of words to express high-level features like lambdas (from a word "jump", "until" or "instruction-pointer" for example).
It's cool to program :-)