3 ms·
This is how most interpreted languages work. The actual hardware stack (e.g. what $rsp points to) isn’t really relevant to the Python program being executed; it
by saagarjha 8y ago
This is how most interpreted languages work. The actual hardware stack (e.g. what $rsp points to) isn’t really relevant to the Python program being executed; it’s used by the native code in the interpreter itself. Pushing a Python stack frame intermingled with a hardware stack frame would be odd (and would likely be hard to do, and weird from an ABI perspective). It’s just easier to push the call stack to a dedicated section on the heap; the Python program doesn’t know the difference anyways. Plus, you can have a much larger stack by heap allocating it.