Re:Why Concatenative Programming Matters (2012)
by h3rald on Tuesday December 01, 2020 @02:54PM
(#25269110)
Having created a small concatenative language myself[1], no, the pure concatenative style with no variables and stack combinators is just too much for a normally-wired brain.
BUT! I tried to cheat a little bit to make things more readable. Take this example from the min front page, which showcases its concatenative style:
. ls-r
(mtime now 3600 - >)
filter
Can you guess what it does? You might, but what about this:
Now ok, I went insane with sigils and weird operators but:
- creating variables helps
- using infix notation via the infix-dequote (><) operator makes expressions much more readable
Why would I use this rather than a traditional language? It helps reasoning in terms of point-free function composition and in some case it is faster to work with, i.e. processing rules, pipelines, task sequences etc.
BUT! I tried to cheat a little bit to make things more readable. Take this example from the min front page, which showcases its concatenative style:
Can you guess what it does? You might, but what about this: Now ok, I went insane with sigils and weird operators but: - creating variables helps - using infix notation via the infix-dequote (><) operator makes expressions much more readableWhy would I use this rather than a traditional language? It helps reasoning in terms of point-free function composition and in some case it is faster to work with, i.e. processing rules, pipelines, task sequences etc.
[1] https://min-lang.org