Yeah! Other examples of languages like this include Thue and Egel. These are known as string-rewriting systems and they happen to be Turing-complete with only one metarule.
Meta: I don't know how it's best done, but I think this should be an authored-by post instead of a via-member post? It can't be suggested.
This is a cute little term-rewriting language. I'm a little confused about how to do applicative things or manipulate sequences (concatenation, append at one end, reverse, etc.) but I think it's a great distillation of several recent discussions.
The syntax looks quite familiar. It's more-or-less the same grammar accepted by egg, or at least the built-in SymbolLang. I think it's close enough that I could perhaps generate Modal from egg rules, or vice versa! Check out these rewrite rules, lines 100-288.
Here's a reason I might want sequence-editing tools. Given the following rules (a fragment of point-free STLC):
I'm wondering how I should hope to rewrite the following term:
.. (comp (pair (zero) (zero)) fst)
In order to get it down to normal form, I can add exactly two rules, but if I add the natural third rule then I get an infinite loop. (Full code here.) Indeed, I'm not sure what should happen for rules which recurse endlessly. One way to avoid this particular problem is to allow for associative operators, or (as egg chose) let users manually write the rules and eat the performance cost. Perhaps future interpreters could have cycle detection?
This language looks complete enough for submission to the esoteric languages wiki. Let me know if you'd rather let me do it; I can do the infobox and categories.
Thanks for the suggestion, I can't change it after the fact. If a moderator can change it, I'd agree that it's applicable.
It's really interesting that the syntax is almost identical. I worked on this language in 2018 out of spite after seeing the Mill architecture make the rounds. I had a prototype in Python and a sketch in VHDL, with the intent of making an incredibly simple machine model that could do delimited string rewriting.
I have an ultimate goal of establishing a full hardware and software stack oriented in rewriting. Modal was a prototype built out of spite. I'm of the opinion that complex subjects are complex because we allow them to be, and if we apply some amount of reduction, we can get to the actual, simple core underneath.
Do note, this isn't quite term rewriting. The evaluation model is based around delimited string rewriting, so there are no function symbols. It's just sequences of symbols that are stepped through according to a queue model (at least, with the Python implementation). Model is effectively a fanciful queue automaton.
If you're on IRC, I've created a channel, #modal, for further discussion. We can debug in-depth there. There's also the Discord link at the bottom of the page.
As for the wiki, go right ahead! I'd be glad to see an entry on Modal. All I ask is for proper attribution.
It's mind boggling the source code is just a couple of functions
Yeah! Other examples of languages like this include Thue and Egel. These are known as string-rewriting systems and they happen to be Turing-complete with only one metarule.
Meta: I don't know how it's best done, but I think this should be an authored-by post instead of a via-member post? It can't be suggested.
This is a cute little term-rewriting language. I'm a little confused about how to do applicative things or manipulate sequences (concatenation, append at one end, reverse, etc.) but I think it's a great distillation of several recent discussions.
The syntax looks quite familiar. It's more-or-less the same grammar accepted by egg, or at least the built-in
SymbolLang. I think it's close enough that I could perhaps generate Modal from egg rules, or vice versa! Check out these rewrite rules, lines 100-288.Here's a reason I might want sequence-editing tools. Given the following rules (a fragment of point-free STLC):
I'm wondering how I should hope to rewrite the following term:
In order to get it down to normal form, I can add exactly two rules, but if I add the natural third rule then I get an infinite loop. (Full code here.) Indeed, I'm not sure what should happen for rules which recurse endlessly. One way to avoid this particular problem is to allow for associative operators, or (as egg chose) let users manually write the rules and eat the performance cost. Perhaps future interpreters could have cycle detection?
This language looks complete enough for submission to the esoteric languages wiki. Let me know if you'd rather let me do it; I can do the infobox and categories.
Thanks for the suggestion, I can't change it after the fact. If a moderator can change it, I'd agree that it's applicable.
It's really interesting that the syntax is almost identical. I worked on this language in 2018 out of spite after seeing the Mill architecture make the rounds. I had a prototype in Python and a sketch in VHDL, with the intent of making an incredibly simple machine model that could do delimited string rewriting.
I have an ultimate goal of establishing a full hardware and software stack oriented in rewriting. Modal was a prototype built out of spite. I'm of the opinion that complex subjects are complex because we allow them to be, and if we apply some amount of reduction, we can get to the actual, simple core underneath.
Do note, this isn't quite term rewriting. The evaluation model is based around delimited string rewriting, so there are no function symbols. It's just sequences of symbols that are stepped through according to a queue model (at least, with the Python implementation). Model is effectively a fanciful queue automaton.
If you're on IRC, I've created a channel, #modal, for further discussion. We can debug in-depth there. There's also the Discord link at the bottom of the page.
As for the wiki, go right ahead! I'd be glad to see an entry on Modal. All I ask is for proper attribution.