3 ms·
Pre-1.0 Rust used to have infinitely growing stacks, but they abandoned it due to (among other things) performance reasons (IIRC the stacks were not collected w
by aidenn0 1y ago
Pre-1.0 Rust used to have infinitely growing stacks, but they abandoned it due to (among other things) performance reasons (IIRC the stacks were not collected with Rust's GC[1], but rather on return; the deepest function calls may happen in tight loops, and if you are allocating and freeing the stack in a tight loop, oops!)
1: Yes, pre-1.0 Rust had a garbage collector.
- RustSupremacist 1y agoRust still has garbage collection if you use Arc and Rc. Not a garbage collector but this type of garbage collection.
- echelon 1y agoYou mean Drop, which is entirely predictable and controlled by the user?
- aidenn0 1y agoI'm going to veer into no-true-scottsman territory for a bit and claim that those don't count since they cannot collect cycles (if I'm wrong and they implement e.g. trial-deletion, let me know). This isn't just academic, since cyclic data-structures are an important place where the borrow-checker can't help you, so a GC would be useful.