I started looking into Kotlin a few weeks ago, and am a big fan. I won’t list all the things I like about it, except to say that it seems like a very pragmatic language. I was glad to see that the builtin kotlin package was cleaned up a bit between beta 4 and RC1, moving most of the specialized builtin-related types, like LongRange, into more specific packages. The major exception is the special array types, like LongArray, which are still in the kotlin package. I’m curious as to why those classes are necessary at all. If “Array” had been made an interface instead of a class, those classes could simply implement the Array interface, and only their factory functions (i.e.
intArrayOf(42)) would have to be exposed… the fact that in practice those particular array types were implemented via something other than the main Array implementation for performance reasons could be a hidden implementation detail, which would both give the Kotlin team more flexibility to change how those optimizations work, and eliminate some slightly confusing clutter in the builtins package (the fact that the recommended type of an integer array isn’t
Array<Int> is a little surprising).
Even if that’s not possible, I’d also suggest that if the *Array classes really do exist purely for performance reasons, and
Array<Int> still works perfectly fine, do the optimized classes need to be in the builtins package? To me, a performance optimization not necessary for fundamental use of the language would make more sense in a less prominent location.