Been a while since I touched it but I've been
building a toy postfix stack-based language to inflict upon my kids. My theory is:
⢠postfix may have benefits for early teaching (linear evaluation order, lack of "syntax", trivial notional machine)
⢠the obvious drawbacks can be somewhat mitigated if instead of destructively changing the stack, you can navigate all previous stack states. (I'm not the first to try the latter; in particular Kartik did it in Mu, including descending into function calls. I don't even have user-defined functions yet.)
⢠I wanted to explore "replacing" some uses of control structures with composition of a bigger data type, like a whole picture or animation.
I'm resigned to the thing not being turing-complete.
Initial implementation's data type was 1D "animation" of color change (I wanted them to program an RGB lamp):
https://asciinema.org/a/zObMq9ZLJQNA99X3EhdEDllhA
=> My kids liked typing and mixing colors, but the idea of a single value representing change over time went entirely over their heads š
Anyway terminal REPL was a dead end, because you can't go back and edit past code. => I got a prototype web editor ā you can move cursor, edit freely, and see stack state before each word:
https://animation-stack-language.netlify.app/
TODO: rendering still uses styled block characters š§āš», I need to learn canvas...
TODO: Next big step will be to replace the data type from 1D "time" to 2D "picture", taking inspiration from
forthsalon.appspot.com and
code.world .
I'm thinking to make do with some 2D rather than RGB colorspace, so that every pixel can also be interpreted as a vector. That way any picture doubles as a limited representation of function-as-data (not turing-complete! but very visual š¤).