News for hackers. Stuff that matters.
Re:Java 8: New features in ConcurrentHashMap by bad_user on Wednesday January 18, 2017 @12:57PM (#13428523)
> Generics in Java are almost entirely syntactical sugar (due to type erasure).

Well, from that point of view, static typing in general is just syntactic sugar. In fact type erasure is one of the best things going for Java, because they haven't screwed the runtime for other languages (e.g. Scala, JRuby, Clojure). Ironically it is the JVM that turned out to be the multi-language VM, with the CLR having only languages that have basically C#'s type system.

No, the problem with Java generics is that covariance / contravariance rules are "call site", specified with wildcards, which are awkward and hard to reason about, versus "declaration site" in Scala and C#.

Scala also has higher kinded types, one of the few languages actually. In combination with making it possible to encode type-classes, by means of plain traits along with implicits, you can express Haskell's powerful abstractions in Scala. You don't see libraries like Cats or Scalaz in other languages like Java or C# or F# for that matter, because they can't be expressed in languages without higher kinded types.

Re:Java 8: New features in ConcurrentHashMap by mike_hearn on Wednesday January 18, 2017 @04:14PM (#13430343)
Java generics are being upgraded. Declaration site variance is coming:

http://openjdk.java.net/jeps/300

And they're also adding type specialisation and reified generics as part of the value types work, somewhat similar to what's available in C++ (but a bit less crazy).

Re:Java 8: New features in ConcurrentHashMap by bad_user on Thursday January 19, 2017 @04:48AM (#13434444)
Declaration site variance is good, except that for Java I have doubts because it's being added in addition to what it currently has.

Specialization for value types != reification and from what I understood from their proposal they are not introducing reification, for one because they still have backwards compatibility concerns, but also because they don't want to screw other languages. I hope those plans haven't changed.

Re:Java 8: New features in ConcurrentHashMap by mike_hearn on Wednesday January 25, 2017 @04:44AM (#13480059)
Foo<any T> reifies T. Foo<T> does not.