3 ms·
> Plus, history has taught us that retrofitting generics to existing languages with their ecosystems can be difficult and painful (see Java and to some extend C
by mook 7y ago
> Plus, history has taught us that retrofitting generics to existing languages with their ecosystems can be difficult and painful (see Java and to some extend C++).
I believe that C# also had retrofitted generics, but the reputation there doesn't seem nearly as bad. But I believe the generic containers there were intentionally not compatible with the original non-generic version.
- jen20 7y agoThe major difference is that the CLR is aware of generics rather them being a compiler trick as they are with the JVM. Don Syme (father of F#, who also worked on the implementation of generics in the CLR) did a talk explaining the history and how they almost shipped with erased generics like the JVM. On the other hand, it's been claimed that erased generics have made things easier for implementing other languages on the platform, so there are tradeoffs I guess. Having used both I would take the CLR implementation any day.
- pjmlp 7y agoSame here, but I still have high hopes for Valhalla.
- pjmlp 7y agoNot at all, Microsoft just decided not to delay .NET 1.0 release instead of having them fully implemented. https://mattwarren.org/2018/03/02/How-generics-were-added-to-.NET/ https://mattwarren.org/2018/03/02/How-generics-were-added-to...