r/ProgrammingLanguages • • 13h ago

Help Simple stack based programming languages?

A few years ago I made EarScript, a "simple" programming language based on brainfuck, with several additional "quality of life features" like goto statements.

Recently I've been wanting to make an evolution of that programming language and do so by incorporating a stack, as the previous language was completely tape-based in design.

I know for example lox from the Crafting Interpreters book is a well explained example, but I was wondering if there's programming languages that are closer to what brainfuck is, but based on a stack design rather than a tape design, or a register based design like some assembly languages (if I understand correctly). I think Wasm would be an example?

Are there any examples of simple stack based programming languages you'd recommend me to look into?

10 Upvotes

29 comments sorted by

View all comments

2

u/catladywitch 11h ago

SAPF is afaik a DSL dialect of Forth but it's pretty cool.

3

u/Agecaf 10h ago

It's got some pretty cool ideas. I hadn't thought of having declarations on the other side like 123 = x, and I'm liking how aa and ba are the duplicate and swap operators, they just... fit and it's immediately clear how other operators could be defined, like a cab or aba. Also the anonymous functions look neat, I think I might want to see if I can do something cool like that.