3 ms·
I could easily imagine trying to do it because I can rather than because I actually need to. Also because of the missing middle: in Go (or Java, or C#, or even
by masklinn 3y ago
I could easily imagine trying to do it because I can rather than because I actually need to.
Also because of the missing middle: in Go (or Java, or C#, or even python) you could hand out slices to a large buffer, but discard the buffer rather than refill it in place, relying on the GC to clean things up (and possibly give you the same buffer on the next allocation). So you get an efficiency middle ground where you allocate more than strictly necessary but not for every line, and maintain correctness.
In Rust that’d require some sort of Rc projection which I’m not sure even exists?