3 ms·
They never resisted generics as a concept. But they refused to implement generics in a way which compromised other Go values. Compilation speed was a big one. I
by kortex 5y ago
They never resisted generics as a concept. But they refused to implement generics in a way which compromised other Go values. Compilation speed was a big one. It's easier to implement generics if you sacrifice compilation speed (see: c++, rust, and iirc java). To their credit, it took the community a looong time to figure out how pull that off, because it's a hard problem. But I think they've done it.
- esprehn 5y agoFWIW Java doesn't sacrifice compiler speed for generics, they're entirely erased at compile time which is cheap. What they sacrificed was runtime correctness, because the type erasure lets you sneak invalid types into unsuspecting code. How much of a problem that's caused in the real world is debatable.