Hacker News new | past | comments | ask | show | jobs | submit login

Here's a little zine on multiset rewriting(unordered term rewriting), John Conway said(about Fractran in The Book of Numbers) that it is such a simple paradigm of computation that no book is needed to learn it, and it can be taught in 10 seconds.

https://wiki.xxiivv.com/site/pocket_rewriting




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.


There's Pure, but it's not exactly mainstream: https://agraef.github.io/pure-lang/


The foundations of Wolfram Language (Mathematica) are about transformations on symbolic expressions, at least conceptually.


I would think that's still the case.


https://www.researchgate.net/publication/243768023_Mathemati...

Mathematica is at least semi-mainstream. Not sure of any other examples though.


Maude is the most famous one that I know of I think.

https://maude.lcc.uma.es/maude-manual/maude-manualch1.html#x...


I think the issue is performance. A true term rewriting system has to essentially operate on text, right?


No, 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.


Hmm 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.


Yes, 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.


Not necessarily, I would think terms can be converted to numbers like how the Ruby vm compiles symbols.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: