> It could be overridden only for new threads when creating them.
I'd rather say you can _only_ control the size of the main thread's stack at compile/link time. Any other thread can have a non-default size.
> You can't increase stack size of already running Lua VM thread.
There is no such thing as a "Lua VM thread". Any native thread (or fiber) can be running in a given Lua VM at any given time, what thread it is, whether it is the same thread all the time, or even whether there are concurrent threads in the VM, is beyond the control of the Lua VM.
> Nothing prevents you from checking stack size in your own application (and raise an error if the next operation might use more stack space than you have available).
I am sure you can, in principle, come up with a set of constraints and measures aimed at ensuring safety for any given application.
The problem is the qualification "for any given application".
Another problem is "in principle", because it can be had or impossible in practice.
I am all for Lua's having a way to ensure true safety of at least its own stack use, but compile/link time constants aren't that way (in general).
Cheers,
V.