News for hackers. Stuff that matters.
Re:How generics were added to .NET by Gibbon1 on Monday March 05, 2018 @07:40PM (#16525936)
One the way to looking at other things(tm) I found a blog post by a CS language researcher talking about type erasure.

His two points.

Being able to do type erasure is great because it means your language is coherent. (Don't need to do any nasty kluges in the run time)

And then everyone ratfucks themselves by actually implementing type erasure, and now your language will never have good tooling and thus will die a lonely unmourned death.

He commented that C/C++ has type erasure and it's also a massive kludge (via the elf format). No one will invest that much effort into a new language.

tl;dr: Type erasure, it's great, don't do it.

Re:How generics were added to .NET by eeperson on Monday March 05, 2018 @08:02PM (#16526055)
What tooling do you think is missing due to erasure?
Re:How generics were added to .NET by Gibbon1 on Tuesday March 06, 2018 @12:40AM (#16527100)
Not a CS person, but I think if you keep the type information pined to the object in memory then a debugger can use the object type information in memory to match it with the object's definition in the program. That makes creating a debugger easy.

Imagine wanting to know what the object at address 0x34199920 is. If you have type info[1] you can cross reference the type info with 'generic array' and then do the same with element 2, address 0x34199920 and know it's a 'foo object'.

[1] Say the first 4 bytes is _always_ a type index that the compiler or interpreter generates.