Well, these variables are references to immutable lines that are allocated at compile time.
Of course, it depends on the VM, but in general, I think most C scripting languages โโallocate a large block of memory, expanding it as necessary and making its own distribution inside it, rarely if ever give O / S. Especially in the lexically limited language, which almost all of them, variables are distributed dynamically inside this block, and not on anything similar to the C stack, and they are freed up either with reference counting or with a garbage collector.
If your scripting language is running on the JVM or .NET or something like this (Parrot?), Creating a variable is just creating something like a Java object. Some time after there are no more references to the object, the garbage collector will return the memory.
Joel hoffman
source share