Mlatu is a statically typed concatenative programming language. It is purely functional with algebraic effects. It currently compiles to Rust but I may switch to Erlang.
I’d love any feedback or constructive criticism you guys have!
I've even felt this niche so underrepresented that I have been thinking about creating a language for it myself. So maybe you beat me to it, or rather I can look to you for some inspiration :p
Question: What made you chose to compile to Rust instead of to LLVM or something like that? Do you make use of the memory safety you gain this way in some interesting ways?
To be honest, I chose Rust because it was the most performant imperative language I know, not so much for its memory safety. I chose to transpile instead of generating LLVM because I wanted to focus on the frontend and type system more than the backend, and LLVM felt like it would get in the way more than enable it.
> "It currently compiles to Rust but I may switch to Erlang."
Why one or the other? Why not both? :)
This definition is far from rigorous, but it's good enough for identifying concatenative languages in practice.
Most concatenative languages are stack-based, but there are some stack-based languages that are not concatenative (e.g. Befunge, a 2d language with self modifying code) and concatenaive languages that are not stack-based (e.g. Enchilada, which is based on term rewriting).
The definition I saw ages ago is much more strict:
If P is a program in a concatenative language, then for any A, B such that P=concat(A,B) and A and B are non empty valid programs, then executing A followed by executing B is equivalent to executing P.
This does classify Forth, Joy and Factor as concatenative but not Python or line-number-less Basic. Not familiar with Enchilada.
I actually got interested in this from a data compression persepective - dictionary compression of a concatenative program - even something as simple as LZ78, is LZ optimal, but still executable without decompressing…..