Most active commenters
  • llm_trw(3)

53 points boris_m | 21 comments | | HN request time: 2.097s | source | bottom
1. BoiledCabbage ◴[] No.42066515[source]
Term re-writing systems are a really interesting way of looking at computation.

It completely abstracts away the concept of a machine, and it's simply translation as computation - but equally as powerful.

replies(3): >>42066655 #>>42066678 #>>42067446 #
2. simplify ◴[] No.42066655[source]
Agreed. This reminds me – and I wonder if it could be applied – to Computational Type Theory, which relies on a similar concept of "reducing" types to their primitive forms, actually taking computation into account (something type theories normally do not!)

This lecture series goes into how it works: https://www.youtube.com/watch?v=LE0SSLizYUI

3. llm_trw ◴[] No.42066678[source]
It's a shame the standard texts are all 20 years old or more than way too heavy mathematically.

A little book for term rewriting would be a great new addition.

replies(1): >>42067199 #
4. llm_trw ◴[] No.42066742[source]
This is vastly more pattern matching than term rewriting. In a term rewriting system you have no types for a start: https://en.wikipedia.org/wiki/Rewriting
replies(1): >>42067012 #
5. convolvatron ◴[] No.42067012[source]
is that important here? it looks like semantically types as presented are no more than magic constants to match on
replies(1): >>42067135 #
6. llm_trw ◴[] No.42067135{3}[source]
Yes, in term rewriting systems the only thing that matters is the lexical structure of the "program" you're running on top of the transform rules. A simple example of running a TRS is a term of a BNF grammar, a less simple one is a symbolically expanding a term in a computer algebra system.
replies(1): >>42067605 #
7. entaloneralie ◴[] No.42067199{3}[source]
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

replies(1): >>42069293 #
8. lo_zamoyski ◴[] No.42067446[source]
I would argue that it is more "primordial". After all, computation is first and foremost a human activity, generally performed using pen and paper, which involves a good deal of rewriting (computers were originally people). The machine only came later as a way to simulate this human activity. Its meaning is entirely contingent on the primordial notion. It have no meaning on its own.
replies(1): >>42070162 #
9. convolvatron ◴[] No.42067605{4}[source]
ok. sorry, so the issue is not that some of the runtime data is being interpreted as types, its that decisions are being made based on the data and not solely on the structure of the program.
10. BoiledCabbage ◴[] No.42069293{4}[source]
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.

replies(5): >>42069569 #>>42069855 #>>42070879 #>>42071115 #>>42072164 #
11. Jtsummers ◴[] No.42069569{5}[source]
https://www.researchgate.net/publication/243768023_Mathemati...

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

12. entaloneralie ◴[] No.42069855{5}[source]
Maude is the most famous one that I know of I think.

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

13. practal ◴[] No.42070162{3}[source]
Of course term rewriting has a meaning of its own, it is at the same time more meaningful and simpler as any other form of computation.
14. opminion ◴[] No.42070879{5}[source]
The foundations of Wolfram Language (Mathematica) are about transformations on symbolic expressions, at least conceptually.
15. alxmng ◴[] No.42071115{5}[source]
I think the issue is performance. A true term rewriting system has to essentially operate on text, right?
replies(2): >>42071220 #>>42071290 #
16. Jtsummers ◴[] No.42071220{6}[source]
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.
17. simplify ◴[] No.42071290{6}[source]
Not necessarily, I would think terms can be converted to numbers like how the Ruby vm compiles symbols.
18. kazinator ◴[] No.42071315[source]
Marty Alain's Lambdaway is another term-rewriting evaluator, of sorts.
19. James_K ◴[] No.42071416[source]
I'm really annoyed when lisp languages use infix operators. Is it really so hard to write (= (f a) b) over (f a = b)? In fact, can you even call it lisp if the first element of the list isn't the operation of that list? Perhaps if they had a special bracket type for definitions I would be more amenable to it, but the idea that a symbol half way through a list completely changes its meaning simply doesn't sit right with me. Isn't this just a term rewriting system with an extra pair of parentheses?

Also, why is this needed over the second line?

  (map a (:lambda fun) = fun a)
  (map a fun = fun a)
20. UncleOxidant ◴[] No.42072164{5}[source]
There's Pure, but it's not exactly mainstream: https://agraef.github.io/pure-lang/