What is this for? What's something you make with it (or do you make stuff with it?)
Modal is a matrioshka language based on pattern-matching to rewrite trees
11–20 of 23 posts
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#12Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#13https://adam.math.hhu.de/#/g/leanprover-community/NNG4
I recall the feeling, being one of many who "rediscovered" Gröbner bases. This is why one studies history, to recognize the taste when one is a turn away from new history:
There was a leap needed, to generalize Gaussian elimination and the Euclidean algorithm to their common ground of arbitrary polynomials. There's a further leap to noncommuting strings, and then there's typed trees, the "algebraic datatypes" 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's notions of rational and algebraic languages apply.
The idea of a term ordering is too gnarly here (well past the interstellar frontier of "decideability") for anything besides human intuition or deep learning.
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.
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#14Really cool looking stuff though.
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#15Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#16https://mathematica.stackexchange.com/questions/119933/why-d...
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#17Howdy. I'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 "You don't need fancy designs to do high-level things on bare metal!" At the time, I called it a term rewriting language, which seem a bit of a weaker label than what it is. It's more like a string rewr…
I like that Modal just rolls with Peano arithmetic rather than awkwardly bolting on numerics. It's impractical, but it doesn't have to be practical - this is an exploration of a concept
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#18Seems like something that could be leveraged in optimization and AST lowering with great success. Admittedly the examples on the main page aren't well explained, so requires a bit of groking. Really cool looking stuff though.
Treecc[0] is probably the closest I've found and AFAICT would have to be beaten into submission to provide similar functionality. Plus its been abandoned and quite complicated methinks.
There was a project doing almost exactly what I wanted but in a different domain but, unfortunately, my indexing skills are subpar and I can't remember what it was called so it's lost...
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#19Howdy. I'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 "You don't need fancy designs to do high-level things on bare metal!" At the time, I called it a term rewriting language, which seem a bit of a weaker label than what it is. It's more like a string rewr…
Term rewriting is woefully overlooked, maybe because the paradigm is rather open-ended. Questions about fixed or variable arity, what rules to apply in what order, what kinds of pattern matching to support, can make the language very limited or intractably inefficient depending on the answer. I like that Modal just rolls with Peano arithmetic rather than awkwardly bolting on numerics. It's impractical, but it doesn't…
Built-in rules that take priority over user-defined ones, as well as special variables in Devine's implementation, allow us to gain back speed while retaining some idea of purity. We know these operations can be phrased in terms of rewrite rules, so let's shortcut them and use built-in arithmetic in place.
You'd never know the difference! There's also a lovely arithmetic library built by d6 that you may enjoy. It does arithmetic digit-by-digit, and they're continually improving it to run faster.
https://git.phial.org/d6/modal/raw/branch/d6/binary/arith.mo...
Re: Modal is a matrioshka language based on pattern-matching to rewrite trees
#20Looks a bit like "Tcl from first principles".