4 ms·
I think it’s fair to say that knowing what allocates in Go requires in-depth knowledge of its internals, well beyond the `defer` example. Every possible allocat
by hellcow 3y ago
I think it’s fair to say that knowing what allocates in Go requires in-depth knowledge of its internals, well beyond the `defer` example. Every possible allocation is not obvious to the typical Go programmer. It is obvious in Zig.
- vacuity 3y agoAlthough with a language like Go, I would think programmers should expect that allocations occur frequently, and rely on the GC and language design to ensure decent performance or whatever is being asked for. It won't hold true all the time and sometimes more knowledge is needed, but the baseline wouldn't involve that.