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

This is indeed much better. I couldn't really follow the original, but this one made it click. Pretty cool!

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

I believe this to be correct, where code and data are arguments consisting of binary trees constructed from pairs or can be 'nil:

    (define apply
      (lambda (code data)                       
        (match (code . data)
          [('nil       . z)       (z . 'nil)]   ; rule 0a - construct stem
          [((y . 'nil) . z)       (y . z)]      ; rule 0b - construct fork
          [('nil . y) . z)        y]            ; rule 1 - K combinator
          [(((x . 'nil) . y) . z) (apply (apply x z) (apply y z))] ; rule 2 - S Combinator
          [(((w . x) . y) . 'nil) w]                               ; rule 3a - pattern match case of data is leaf
          [(((w . x) . y) . (u . 'nil)) (apply x u)]               ; rule 3b - pattern match case of data is stem
          [(((w . x) . y) . (u . v)) (apply (apply y u) v)]        ; rule 3c - pattern match case of data is fork
         )))
https://olydis.medium.com/a-visual-introduction-to-tree-calc...

https://github.com/barry-jay-personal/tree-calculus/blob/mas...

Surely there is a middle ground between a book length treatment and whatever the linked page was that fails to give a definition or motivation.

My friend this ain't memes or celebrity news, it's theoretical computer science. You'll get out of it roughly what you're ready to put into it. If you're short on time, the grammar is like 5 characters and the proof of the halting problem isn't much bigger. If you don't already know why that is interesting though you really might have to read a bit to find out

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