Re:Go 1.18 Beta 1 is available, with generics
by kortex on Wednesday December 15, 2021 @09:20AM
(#29566264)
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.
[ Parent
| on HN ]
Re:Go 1.18 Beta 1 is available, with generics
by esprehn on Wednesday December 15, 2021 @09:54AM
(#29566722)
FWIW 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.
Re:Go 1.18 Beta 1 is available, with generics
by inglor on Wednesday December 15, 2021 @10:11AM
(#29566976)
Are you sure you are not mixing up runtime impact with compiler speed? In Java generics are still part of the type system and are type checked which is a non trivial part of the compile time increase in generics typically.