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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Modal is a matrioshka language based on pattern-matching to rewrite trees

92 点作者 smlavine大约 1 年前

7 条评论

wryl大约 1 年前
Howdy.<p>I&#x27;m Wryl, the original author of this language. I sketched it out in late 2018 and played with it in 2019 after seeing some Mill architecture articles floating around. I mostly created it out of spite, thinking &quot;You don&#x27;t need fancy designs to do high-level things on bare metal!&quot;<p>At the time, I called it a term rewriting language, which seem a bit of a weaker label than what it is. It&#x27;s more like a string rewriting system with variables and nested strings, with parentheses acting as the separators for sub-strings.<p>It got to the point where I could transcribe Quicksort from the Haskell wiki into a fragment of Modal. I stopped playing with it after I had some not-so-fun industry experiences, and declared my work a dead-end.<p>Devine from Hundred Rabbits managed to get me to talk about it a bit more, and has taken the language far beyond what I could dream of. It&#x27;s now gone beyond a sketch to a genuine marvel of engineering which is continually being refined as we figure out more idioms. The language is in very good hands.<p>I&#x27;m of the opinion that rewriting is an unexplored paradigm, and that we don&#x27;t really understand how to build software. Modal was a product of my research efforts, which are still on-going. I hope to bring more projects like this to light. This has been quite fun.
评论 #40130496 未加载
nemoniac大约 1 年前
In comparison, the Mathematica programming language is based on term rewriting.<p><a href="https:&#x2F;&#x2F;mathematica.stackexchange.com&#x2F;questions&#x2F;119933&#x2F;why-did-the-mathematica-language-choose-term-rewriting-instead-of-the-lambda-cal" rel="nofollow">https:&#x2F;&#x2F;mathematica.stackexchange.com&#x2F;questions&#x2F;119933&#x2F;why-d...</a>
junon大约 1 年前
Seems like something that could be leveraged in optimization and AST lowering with great success. Admittedly the examples on the main page aren&#x27;t well explained, so requires a bit of groking.<p>Really cool looking stuff though.
评论 #40131638 未加载
评论 #40133430 未加载
Syzygies大约 1 年前
For perspective, one might look at the Natural Number Game, an introduction to mathematical proof using the language Lean 4:<p><a href="https:&#x2F;&#x2F;adam.math.hhu.de&#x2F;#&#x2F;g&#x2F;leanprover-community&#x2F;NNG4" rel="nofollow">https:&#x2F;&#x2F;adam.math.hhu.de&#x2F;#&#x2F;g&#x2F;leanprover-community&#x2F;NNG4</a><p>I recall the feeling, being one of many who &quot;rediscovered&quot; Gröbner bases. This is why one studies history, to recognize the taste when one is a turn away from new history:<p>There was a leap needed, to generalize Gaussian elimination and the Euclidean algorithm to their common ground of arbitrary polynomials. There&#x27;s a further leap to noncommuting strings, and then there&#x27;s typed trees, the &quot;algebraic datatypes&quot; foundation of languages like Haskell and Lean 4. To see term rewriting in these settings as a continuum, one needs to incorporate recursion, to understand how Schützenberger&#x27;s notions of rational and algebraic languages apply.<p>The idea of a term ordering is too gnarly here (well past the interstellar frontier of &quot;decideability&quot;) for anything besides human intuition or deep learning.<p>Nevertheless, one sees that term rewriting on typed trees can be the foundation of human thought. Deep learning, while impressive, struggles to simulate recursion using multiple layers. We are discovering exactly how fundamental recursion is to thought. A version of neural nets more closely based on a probability substrate of typed trees might more adeptly model thought.
mhd大约 1 年前
Looks a bit like &quot;Tcl from first principles&quot;.
评论 #40133417 未加载
transfire大约 1 年前
I wonder if this could be implemented via interaction nets.
_akhe大约 1 年前
What is this for? What&#x27;s something you make with it (or do you make stuff with it?)
评论 #40128337 未加载
评论 #40129390 未加载
评论 #40129267 未加载