Hacker News new | ask | show | jobs
by grumpyprole 2844 days ago
Not necessarily, specialisation is only argubly required for unboxed types. Java actually implements "Generics" without any specialisation at all, it boxes all the primitive types (rather controversially).
1 comments

And that has a baggage of problems. The best way is what C# does, which incidentally is also what Go does with maps:https://dave.cheney.net/2018/05/29/how-the-go-runtime-implem...
The C#/.NET solution, while very good, has some problems too. By implementing generics so deeply into the runtime, it becomes very difficult to enhance the support in the future, for example adding higher-kinded types (which the F# folks have long been asking for).

I actually quite like the Haskell approach of having a "Specialisation" annotation. I believe Scala has this too.