> In addition, stack-based resource management has predictable runtime performance behavior: when you drop a value from the stack, it gets deallocated, no garbage collector required.
This cannot possibly work for this language. Stack-based memory management only works as long as all references go from "newer" values (higher on the stack) to "older" ones (deeper on the stack). But this language allows you to write a function that rearranges the stack, for example by swapping the two topmost elements.
Consider a scenario where some value x is on top of the stack:
x
Now we build some sort of heap value that has a reference to x and push it onto the stack: box(x)
x
Now swap these: x
box(x)
Then drop x from the stack, for example by printing it. This deallocates x. The stack is now: box(x)
But this value is undefined, since x has been deallocated. You have a use-after-free error.I wish people stopped approaching language design from the point of view that the people who have been working on garbage collection for the last 60 years are all idiots who don't see how simple it all is.