Tree Calculus (treecalcul.us)

97 points by tosh 6 days ago

layer8 an hour ago

> the application of E1 to E2 attaches E2 to the root of E1 on the right.

It’s completely unclear to me what this means. The literal meaning is obviously wrong, because attaching a tree to a root that already has two child nodes would result in a ternary node, but apparently all trees in tree calculus are binary.

macintux 6 hours ago

Extensive discussion (202 comments) about 15 months ago: https://news.ycombinator.com/item?id=42373437

pgt 4 hours ago

The inversion is really cool, e.g.

> f = λa λb concat ["Hello ",a," ",b,"!"] > f "Jane" "Doe" Hello Jane Doe!

then,

> g = f "Admiral" > invert g "Hello Admiral Alice!" Alice

pgt 4 hours ago

@dang, pleaaase can we get proper markdown formatting on HN? I tried adding two spaces after each line, but I don't want paragraphs between code

lupire 2 hours ago

4 spaces indent

The inversion is really cool, e.g.

    > f = λa λb concat ["Hello ", a, " ", b, "!"] 
    > f "Jane" "Doe" 
    Hello Jane Doe!
then,

    > g = f "Admiral" 
    > invert g "Hello Admiral Alice!" 
    Alice

eitally 6 hours ago

Much better intro article about tree calculus here, vs the actual site: https://olydis.medium.com/a-visual-introduction-to-tree-calc...

bawolff 2 hours ago

I feel like neither of these just give actual formal definitions, which would be much clearer.

robot-wrangler 2 hours ago

bawolff 4 minutes ago

macintux 6 hours ago

Another resource I found in HN discussions: https://latypoff.com/tree-calculus-visualized/

tripplyons 6 hours ago

The reduction rules seem kind of arbitrary to me. At that point why don't you just use combinators instead of defining a set of 5 ways their operator can be used?

olydis 5 hours ago

A good point! From the “visual introduction” post mentioned elsewhere: Rules 1 and 2 seem arbitrary […], but behave analogous to the K and S operators of combinatory logic, which is sufficient to bootstrap λ-calculus. Rules 3a-c “triage” what happens next based on whether the argument tree is a leaf, stem or fork. This allows writing reflective programs.

See Barry’s post https://github.com/barry-jay-personal/blog/blob/main/2024-12... for more discussion.

undefined 6 hours ago

[deleted]

gavinray 4 hours ago

This seems really up Stephen Wolframs alley.

He's really into the graphical representation of Turing machines and multiway Turing machines.

tombert 2 hours ago

Tangential, but I read his New Kind of Science book. It's an interesting book, but I found the first chapter to be pretty amusing.

The first chapter is so completely self-aggrandizing about how this book will change your life and the world and the entirety of science and mathematics and you should feel lucky for reading it.

The cellular automata stuff is pretty cool, but I don't feel like it lived up to the hype of the first chapter.

est 3 hours ago

wow this is amazing. There's an old Chinese proverb, 道生一,一生二,二生三,三生万物

The Tao giveth △ (false)

△ gives △ △ (true)

△(△, △) giveth rise to all things computable

(just kidding, I am totally lost to this)

gram-hours 4 hours ago

> Tree calculus is minimal, Turing-complete, reflective, modular

Ok. But what is it?

rhsjie294nd 4 hours ago

A lambda calculus variant Quite niche, so people who read about it know what a calculus is

henearkr 6 hours ago

That makes me think of the Inca's quipus.

timcobb 6 hours ago

I'm not used to math things being promoted like this (not to suggest that's a bad thing at all!). Can someone offer some context please.

seanhunter 5 hours ago

This isn't a math thing[1], it's a theoretical computing model (ie instead of a Turing machine or lambda calculus, you can use this instead) that you might study as part of studying computation theory or other bits of theoretical computer science.

[1] or not pure maths anyway. It's applied maths like all computer science.

phlakaton 4 hours ago

I think it might be a bad thing. I'm no stranger to math or computer science, but even after staring at the front page for a minute I was ready to dismiss this as the ravings of a lunatic.

It's like they had the idea of marketing this like a software project, not realizing that most front pages of software projects are utter bunk as well. It introduces terminology and syntax with no motivation or explanation.

Even once trying to get into "Quick Start" and "Specification" I was still mystified as to what it is or why I should want to play with it, or care. I had to go to the link mentioned upthread to get any sense of what this was or how it worked.

I think it's just badly written.

That being said, what seems to be proposed is a structure and calculus that are an alternative to lambda-calculus. The structures, as you can probably guess from the picture, are binary trees, ostensibly unlabeled except that there is significance to the ordering of the children. The calculus appears to be rules about how trees can be "reduced", and there is where the analogy to lambda calculus comes in.

Hopefully someone who actually knows this stuff can see whether I managed to get all that right – because I promise you, none of that understanding came from the website.