TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

24 pointsby matthewtoastover 9 years ago

2 comments

matthewtoastover 9 years 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.<p>Runiq more or less does this translation:<p><pre><code> source: (hack (the) (planet!)) ast: [&quot;hack&quot;, [&quot;the&quot;], [&quot;planet!&quot;]] reduce order: &quot;the&quot; &quot;planet!&quot; -&gt; &quot;hack&quot; </code></pre> Function tokens map to predefined CPS JavaScript functions:<p><pre><code> &quot;hack&quot;: function(a,b,cb){...}, &#x2F;&#x2F; add numbers &quot;the&quot;: function(cb){...}, &#x2F;&#x2F; return 1 &quot;planet!&quot;: function(cb){...}, &#x2F;&#x2F; return 2 </code></pre> Outputs produce new trees that eventually reduce to a value.<p><pre><code> -&gt; [&quot;hack&quot;, [&quot;the&quot;], [&quot;planet!&quot;]] -&gt; [&quot;hack&quot;, 1, 2] -&gt; [3] -&gt; 3 </code></pre> 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.
kttover 9 years ago
Cool! Reminds me of <a href="https:&#x2F;&#x2F;github.com&#x2F;kanaka&#x2F;miniMAL" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kanaka&#x2F;miniMAL</a>
评论 #10802841 未加载