2 ms·
Both Go and Rust removed segmented stacks, for the same reasons: they can really kill performance. Go now copies stacks, and Rust only has segments if you deli
by steveklabnik 2y ago
Both Go and Rust removed segmented stacks, for the same reasons: they can really kill performance.
Go now copies stacks, and Rust only has segments if you deliberately box up a recursive call.
- duped 2y agoGo stacks are still growable, no? And hence the "kinda" in async Rust. While boxed futures can be thought of as a segmented stack the literal callstack is not, which can still give you a stack overflow with a bunch of nested poll() calls.
- steveklabnik 2y ago> Go stacks are still growable, no? Depends on what you specifically mean by "growable": when a goroutine runs out of stack space, a new one that's larger (iirc double sized) is created, the old one is copied into it, and then execution can resume. I can see the argument both ways. > which can still give you a stack overflow For sure.