@sakiamu I love that!
Also TIL about “concatenative languages”! It’s like programming a giant RPN calculator.
@sakiamu I love that!
Also TIL about “concatenative languages”! It’s like programming a giant RPN calculator.
@drahardja The fun thing is that because they eschew operator precidence (usually, anyway), they are muuuch easier to prototype, and they can get up to some very fun DSL type things with a few mechanisms.
@sakiamu @drahardja I made a concatenative language back in the day, just for my own amusement. I stopped developing it when I realized that I actually preferred hacking on its C-based internals rather than in the language itself. Mine resembled Joy more than Forth - and I also quickly realized that getting that sort of language implemented in a high-performance runtime was difficult for exactly the same reason that fexpr-based Lisps are.
However, there's one thing this experience taught me was a strength of concatenative languages: Interactive programming. Even Lisp or Smalltalk don't compare. The fact that you can stop computing at any point and just have a stack sitting around is *awesome*, and gives a kind of incremental feel I don't think is even possible in applicative languages. You can enter in any partial computation and see exactly what it does to your stack.
If I were to make a language dedicated entirely to livecoding, it'd be concatenative.
@datarama @drahardja I've made a few protoypes of my own, and I'm working on one with a runtime written in Zig called StackTalk.
Funnily enough, my return to catlangs after a long hiatus was to build one that took advantage of the stacks as state to help replace yield in Godot 3. The nested interpreter setup was very slow, but it did work.
@sakiamu @drahardja I paired mine with an Actor-style concurrency system. This simply worked by letting actors put things on top of each other's stacks.
Conceptually elegant - but it turned out to be hard to use in practice.
@datarama @drahardja Yeah, I could see that getting a bit fiddly. A stack is not an inbox without some extra behaviors on top, like always yielding to the actor sent to, maybe a dedicated inbox stack, and/or some kind of transactionality semantics for actor turns.
@sakiamu @drahardja I experimented with a dedicated inbox queue, but what worked best was a pattern matching operator for the top-of-stack element.
Ironically, when I did a dedicated inbox queue with pattern matching and the Joy-style quotation mechanism that was the centrepiece, I realized that I had basically built a postfix version of Lisp-on-top-of-Erlang. :-)
@datarama @drahardja Postfix LFE is pretty sick as an idea, heh.
@sakiamu @drahardja And this was four years before actual LFE!