TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

24 点作者 matthewtoast超过 9 年前

2 条评论

matthewtoast超过 9 年前
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.
ktt超过 9 年前
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 未加载