Skip to content

Comment on Show HN: Runiq, a little Lisp-inspired language that runs on JavaScript

Comments

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.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.