News for hackers. Stuff that matters.
Re:The Java type system is broken by hota_mazi on Thursday July 19, 2018 @02:05PM (#17568871)
Actually, most people who actually understand in depth the subject and the trade offs of erasure versus reification squarely side on the erasure side.

Erasure is the safest way to implement generics for a long list of reasons. Reification comes with a lot of downsides, which is why most languages that support parametric polymorphism use erasure.

Re:The Java type system is broken by kjeetgill on Thursday July 19, 2018 @04:09PM (#17569813)
Interesting, do you have any resources? What people?

Aside from the video I posted from Brian Goetz most of what I've read is just comments about how much people like reification in C# and how annoying those edge cases in Java are (i.e. stories from practitioners not language designers.)

I'd love to read more.

Re:The Java type system is broken by hota_mazi on Thursday July 19, 2018 @04:25PM (#17569928)
There's plenty of material out there but I'll summarize:

1. Erasure keeps you honest and prevents you from second guessing the compiler by limiting the introspection you can perform on your code.

2. Reification puts up a very high barrier to interop. Erasure systems are much more welcoming to implementing multiple languages and multiple type systems on top of them. For example, the scala.net project was abandoned because it was impossible to represent Scala's type system on .net's reified platform.

3. Reification imposes overhead because of the multitude of extra runtime checks that need to be performed.

4. Most the benefits you get from reification can be emulated on erased systems (some are admittedly more hackish on an erased runtime, but they should be rare).

Re:The Java type system is broken by phillipcarter on Thursday July 19, 2018 @08:22PM (#17571499)
I suppose if implemented flawlessly, this would be true:

> Erasure keeps you honest and prevents you from second guessing the compiler by limiting the introspection you can perform on your code

But the title of the article under discussion is called "The Java type system is broken", after all :)