Multistack Concatenative Programming Languages
9 points by intarga
9 points by intarga
This reminds me of a long time ago when I toyed with an idea for an esoteric stack language.
I started with the observation that it seems wasteful to have two stacks, a value stack and a return stack. Why not make return addresses into first class values, put them on the value stack, and get rid of the return stack? (Well, obviously they would get in the way, but this is an esoteric language so it isn’t supposed to be convenient.) First class return addresses sounds a bit like continuations, so why not make the stack into a chain of cons cells, then we can make it into a cactus stack, and we can capture the stack pointer as a first class value as well. (Somewhat inspired by my previous messing around with combinator graph reduction.)
It never went very far because I wasn’t sure what I might use it for, or if it was silly enough to be interesting in its own right :-)
I happen to be working on that esolang, the stack as cons cell tree (with nil as leaf) works very well! And instead of second stack, I direct >R to the other end.
Heh. I started out with one stack for my non-esolang as part of agonisingly re-learning Forth's lessons independently. Other contenders instead of a second stack were: four thousand builtins, stack-shuffling builtins with a depth argument, pointer arithmetic on the stack pointer, or maybe some kind of interleaving where odd-numbered cells were free for whatever use.
Oh yeah, whatever happened to Dawn?