Re:Retro: A Modern, Pragmatic Forth
by Avshalom on Thursday May 23, 2019 @10:29PM
(#19997973)
Forth and APLs both have a really strong data flow aesthetic.
[ Parent
| on HN ]
Re:Retro: A Modern, Pragmatic Forth
by RodgerTheGreat on Thursday May 23, 2019 @10:52PM
(#19998070)
Exactly! They're both concatenative languages, or at least languages which have a concatenative subset. Juxtaposition is composition.
APL/K and Forth also have very concise syntax for declaring functions.
// JS
const foo = (x,y) => 1 + x * y
// K, lambda with implicit arguments
foo: {1+x*y}
// K, points-free
foo: 1+*
// Forth
: foo * 1+ ;
It's subtle, but I think making function declarations "lightweight" in this manner is important for encouraging factoring. In APLs the scale of the semantic units you give names to is a little different, but that's its own separate discussion.
Re:Retro: A Modern, Pragmatic Forth
by fiddlerwoaroof on Thursday May 23, 2019 @11:45PM
(#19998293)
It would be interesting to have a forth where, if you try to pop from an empty stack, you get a function object that consumes the next things pushed onto the stack (i.e. functions are curried)