← Back to context

Comment by stickfigure

14 hours ago

I don't see why this is problematic. Stack is just memory, you can allocate it by incrementing a pointer. Any amount you want, really.

Apache modules worked like this (still do, presumably). Each request has a stack; allocations bump the stack pointer; when a request is finished, the stack pointer is reset. Incredibly efficient as long as you don't need to keep memory longer than a single request.

Looks like in Goose, each scope acts like an apache "request".

In Windows, by default, thread's stack is capped at 1MB. Main thread gets more but that's somewhat off the point.

  • There's stack the CPU primitive, and there's stack the heap-allocated data structure. Goose's multiple stacks are the latter. Unrelated to OS-managed thread stacks. More like VM-managed thread stacks in Java and other bytecode languages, which also live on the heap.