Lang5 – A Stack Based Array Language
lang5.sourceforge.net
lang5.sourceforge.net
Stack based languages replace "dealing with the computer" with "dealing with the stack". Except the stack is always invisible, because it's a runtime artifact and not a code artifact. Their front-page example neatly dodges this, but their examples on the about page make this much more visible. For instance, here's their prime finder:
: prime_list
1 - iota 2 + dup dup dup
'* outer swap in not select
;
100 prime_list .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.
+/ 1+ i.100
Interesting that it was developed for the HP48:
Not sure if it has its niche though. I mean, "stack based" is not really a feature on its own, and we have tons of options to do tensor processing in conventional languages; but the conception is awesome.
Evaluation from left to right is more natural to people using latin alphabet.
It's totally arbitrary anyways. I suspect the only reason why there is right to left evaluation in APL family is to support assignment like this:
x: 1 + 2 + 3
which would have to be the following in left to right 1 + 2 + 3 :x