The theory of concatenative combinators (2007)
tunes.org
tunes.org
S x y z = x z (y z)
K x y = x
These terms can represent any computable function.
This is clean and simple. I don't quite see what the theory of concatenative combinators achieves beyond complicating matters with stacks and quotations to obtain some concatenative property of programs.Tha analogues of S and K in concatenative combinators are
[C] [B] [A] s == [[C] B] [C] A
[B] [A] k == A
which look a bit more complicated, but as the article says this is not even a basis:> This almost gives us completeness; however, there is no way to form "dip" or "sip" using just "s" and "k" because, roughly speaking, they provide no way to dequote items buried in the stack.
What can you express in concatenative combinators that is not as easily expressed in combinatory logic?
I think this has implications for eta-equivalence of programs. I think there are programs that are equivalent in combinatory logic, but not equivalent under concatenative rules.
I also think it affects type-checking, program in concatenative style can (with additional primitives) express "only evaluate if the program typechecks", while I am not sure combinatory logic can express such a program.
[1] https://staff.fnwi.uva.nl/b.vandenberg3/Onderwijs/Proof_Theo...
I don't want to hammer on the other analogy, but perhaps your question (why not just use combinatory logic) is kind of like asking why don't we only use natural numbers, if they are set-theoretically equivalent with integers at large, and at the same time a smaller set. The reason is, of course, the integers reveal something about the structure of natural numbers (or do they artificially add this structure, which one is it, really?). I think concatenative combinators can be considered analogous to integers here.
The Theory of Concatenative Combinators (2007) - https://news.ycombinator.com/item?id=20849180 - Aug 2019 (3 comments)
The Theory of Concatenative Combinators (2007) - https://news.ycombinator.com/item?id=12328870 - Aug 2016 (2 comments)
The Theory of Concatenative Combinators - https://news.ycombinator.com/item?id=11490051 - April 2016 (5 comments)