3 ms·
He's talking about reification versus specialization. The .NET runtime is specializing generics for value types and that's how you avoid boxing. For normal clas
by bad_user 11y ago
He's talking about reification versus specialization. The .NET runtime is specializing generics for value types and that's how you avoid boxing. For normal classes though, specialization would not have any benefit and the boxing argument goes away.
Interestingly, specialization can be done at compile-time and doesn't necessarily have to be a runtime feature. Here's a Scala compiler plugin doing that: http://scala-miniboxing.org/ http://scala-miniboxing.org/
- masklinn 11y ago> He's talking about reification versus specialization. It's neither according to the usual (C++-inherited) lingo where specialisation is the userland override of generics reification. Refinement may be a better term for what the article is talking about (runtime-optimised instances without reified types). And refinements should already be doable in java today with no static type information, Pypy does it with list strategies, I expect Objective-C's hidden classes could also enable it (though I'm not aware of such a use). > Interestingly, specialization can be done at compile-time That's where they started...