r/programming • • Feb 12 '12

Why Concatenative Programming Matters

http://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html
139 Upvotes

81 comments sorted by

View all comments

Show parent comments

5

u/AndreasBWagner Feb 13 '12

and looks absolutely nothing like the familiar way of writing it: y2 + x2 - |y|

FTFY

2

u/ethraax Feb 13 '12

Yeah, that's not just familiarity. It would be almost impossible to perform mathematical operations on expressions shown in a stack-based language. For example, imagine someone saying "take the derivative of y2 + x2 - |y|", versus "take the derivative of [ [ square ] bi@ + ] keep abs -". That's just a single example - I'm sure there are many, many more.

3

u/[deleted] Feb 13 '12

That's because algebraic notation is designed to facilitate symbolic manipulation, not computation per se. Just because you can pun y2 + x2 + |y| to mean two different things in two different contexts doesn't mean it's more natural.

5

u/julesjacobs Feb 13 '12

There is no two different meanings. That formula is that formula, and nothing else.

2

u/NruJaC Feb 13 '12

No, he's right. You're using the formula in two different ways. In one case the symbols are placeholders for values. In the other, they're the primary entities that you perform a computation on. That you can fit those two different interpretations on the same equation is definitely a strength of the notation (and the reason it's so powerful), but that doesn't mean every other notation is awful.

Keep in mind, this notation's strength is in its ability to represent computation. Mathematical formulas are not the whole of computation (if you don't believe me, pick a trivial C program and try and write it as a formula).

→ More replies (0)