3 ms·
Yeah but the thread is about types, not generic types specifically. Also it’s not really true that genetics are erased. There’s that horrible thing javac does
by pizlonator 7y ago
Yeah but the thread is about types, not generic types specifically.
Also it’s not really true that genetics are erased. There’s that horrible thing javac does so that the VM can support reflection for generics. I get your point though.
- titzer 7y agoDo you mean the passing of classes as additional arguments? I haven't seen the horrible thing. Overall I think C# got this one right. Generics are right there in the binaries. bUt ActuALLy, I think the rightest right thing is to do specialization up to representation at link time (or compile time), when the whole program is available, ala MLton. Virgil does this. Of course this is not possible in a dynamic code loading environment but I only have so many fucks to give in this life.
- pizlonator 7y agoNo, I meant that the Class format has metadata about what the genetics were so some java.lang.reflect thing can query about what the genetic type was. I don’t think it comes with soundness guarantees. I agree C# got this right. I agree that doing specialization up to link time is ideal from a certain standpoint.