3 ms·
I'm somewhat surprised there isn't a semi-mainstream language for it. It's incredibly simple, with very few core concepts yet very powerful. Similar to LISP in
by BoiledCabbage 2y ago
I'm somewhat surprised there isn't a semi-mainstream language for it. It's incredibly simple, with very few core concepts yet very powerful.
Similar to LISP in that sense.
- Jtsummers 2y agohttps://www.researchgate.net/publication/243768023_Mathematica_as_a_Rewrite_Language https://www.researchgate.net/publication/243768023_Mathemati... Mathematica is at least semi-mainstream. Not sure of any other examples though.
- entaloneralie 2y agoMaude is the most famous one that I know of I think. https://maude.lcc.uma.es/maude-manual/maude-manualch1.html#x4-40001.1 https://maude.lcc.uma.es/maude-manual/maude-manualch1.html#x...
- opminion 2y agoThe foundations of Wolfram Language (Mathematica) are about transformations on symbolic expressions, at least conceptually.
- lispm 2y agoI would think that's still the case.
- alxmng 2y agoI think the issue is performance. A true term rewriting system has to essentially operate on text, right?
- Jtsummers 2y agoNo, it can operate on a data structure as well. There's string rewriting which does operate on text (but this can be stored in a structure amenable to applying rewrite rules versus brute force copying it or something silly). For term rewriting, there are plenty of efficient ways to store and operate on the information besides just textually.
- alxmng 2y agoHmm maybe I misunderstand. All the rules must be applied to fixpoint or elimination, for every input right? And the larger the program (rule set) the worse the performance since more rules must be evaluated at each “tick” of the program, unless you play tricks with ordering rules.
- Jtsummers 2y agoYes, that's often the objective. If they're properly written they will terminate, but not all sets of rules may terminate. It's possible for rules to cause divergence or cycles. A -> A B (1) A -> B (2) B -> A (1) never terminates, always adding a new B on application but not removing the A. (2) doesn't grow, but never terminates since each term is replaced with the other.
- simplify 2y agoNot necessarily, I would think terms can be converted to numbers like how the Ruby vm compiles symbols.
- UncleOxidant 2y agoThere's Pure, but it's not exactly mainstream: https://agraef.github.io/pure-lang/ https://agraef.github.io/pure-lang/