News for hackers. Stuff that matters.
Re:Lang5 – A Stack Based Array Language by eequah9L on Thursday March 12, 2020 @12:20PM (#22558396)
Stack is cool as long as it's the top element or two that you care about. Anything more complex, and you want (well, I do) some sort of a binding syntax, so that it is possible to refer to the value symbolically. I find all those swaps and dups impossible to reason about.
Re:Lang5 – A Stack Based Array Language by yumaikas on Thursday March 12, 2020 @05:09PM (#22561768)
I've found that there can be some cool stack combinators (like Factor's dip), but binding in stack based languages is nice in that it lets you effectively turn off having to think about the stack in depth, which frees up mental resources for thinking about the problem at hand.
Re:Lang5 – A Stack Based Array Language by codr7 on Thursday March 12, 2020 @01:46PM (#22559564)
Dup and Swap are all about the two top values though.

Otherwise I strongly agree, I like to use bindings for anything non-obvious.

In my own designs [0] I tend to add named arguments [1] as well, which helps a lot.

[0] https://github.com/codr7/gfoo

[1] https://github.com/codr7/gfoo#methods