4 ms·
Runiq is my attempt to tie together a few ideas from Lisp with some features of JavaScript inside an interpreted language. Syntax, flexibility, data-as-code DNA
by matthewtoast 11y ago
Runiq is my attempt to tie together a few ideas from Lisp with some features of JavaScript inside an interpreted language. Syntax, flexibility, data-as-code DNA would come from Lisp, while a JS backing could give reach and a big module ecosystem.
Runiq more or less does this translation:
source: (hack (the) (planet!))
ast: ["hack", ["the"], ["planet!"]]
reduce order: "the" "planet!" -> "hack"
Function tokens map to predefined CPS JavaScript functions:
"hack": function(a,b,cb){...}, // add numbers
"the": function(cb){...}, // return 1
"planet!": function(cb){...}, // return 2
Outputs produce new trees that eventually reduce to a value.
-> ["hack", ["the"], ["planet!"]]
-> ["hack", 1, 2]
-> [3]
-> 3
Runiq is very much an experiment, and some design decisions I made have trade-offs (speed, for one). But Runiq could still find a niche somewhere between grown-up projects like Clojure(Script) and single-purpose languages like PuzzleScript, both of which I admire.