Generics and specialization in another JVM language, Genus


See Table 1 (page 9) for performance results.

My understanding is that Kotlin doesn’t currently support specialization, and I just thought I’d post some food for thought in the case that Kotlin devs haven’t seen it, as I believe this is totally different from how Scala does it (though I’m not very familiar yet with Scala or Genus).

Project page:


The biggest argument agains doing anything with specialization of generics now is that Java is going to have it (hopefully in version 10), and anything we do now is likely to work not so well and has a risk of being incompatible


Ah, I didn't know, that makes sense.


Or maybe even earlier. They checked in a partially upgraded version of java.util to their prototype repository just a few days ago. There are a bunch of TODO comments waiting to be resolved, and there's still a lot to do (Map isn't upgraded yet), but they seem to be making solid progress. I was surprised how few changes most classes/interfaces seemed to require.

That said, the Genus paper does not seem to discuss specialisation much - at least not in the abstract or introduction. So it may prove interesting for Andrey regardless of the Java teams plans.


Their generics system did seem very interesting in the talk I went to, compared to Java, but I haven't really gotten into Kotlin's generics enough to comment yet. I believe they also support a somewhat limited version of dependent types that may or may not be as onerous to deal with in some of the more rigorous sytems, but does distinguish between certain types where java does not (e.g. types that depend on different comparators).