Above all else, what always gets to me with Scala is its powerful generics. It truly is first-class. I'm excited for macros as well.
Above all else, what always gets to me with Scala is its powerful generics. It truly is first-class. I'm excited for macros as well.
If you literally just mean generics at runtime, they are no different than Java's, outside of support for specialization for primitive types.
> Perhaps the OP was referring to the type system instead?
Generics and the type system are pretty much the same thing? They only matter and have true power at compile time regardless of your language. So the fact that Scala's generics have absurd power at compile-time (way more than anything in C#) is 100% relevant.
I searched around a bit about HKT's and although I can't say I understand them, I can see how the ability to do something like provide a constructor over a type could be useful. It feels like it has a lot of use in writing very general-purpose libraries, or perhaps a DSL that can map to a wide variety of different types. Interesting!
The second thing that comes to mind is the ability to support variance. To quote Twitter Scala School: "A central question that comes up when mixing OO with polymorphism is: if T’ is a subclass of T, is Container[T’] considered a subclass of Container[T]?" Scala allows us to express this information using +/- as in `Container[+D]` allows for subclasses of `D`.
Finally, though not so much related, an interesting development in the type space is type macros (http://docs.scala-lang.org/overviews/macros/typemacros.html). This will give us a stronger "generic" approach to programming that allows us to write code to construct type hierarchies. In general, Scala is moving fast and always evolving.
You'd have to be more specific as to what your problems are concerning boxing & jvm. Lists are properly specialized such that a = List(1) == List<Int> and a(0) == Int. Of course, if you use a diverse set of types in the list, you'll have a `List<Any>` which then you would use `match` like so... match item { case i:Int => println("int " + i) case s:String => println("string " + s) }
Scala (my current language), world's apart! I was truly blind to a much higher, cleaner level of thinking/programming until I learned Scala.
Ten years ago I was using Perl to write web applications with HTML::Mason, in a consulting firm. I can't say I miss that :-).