As usual, I’m learning Yet Another Programming Language. Every time I do I see some new ideas and experience new frustrations. This time the language is Scala http://www.scala-lang.org/. There is a lot to like about it.
First, it’s a functional langauge, and I really like functional languages. Second, it is statically typed with type inference, and I like that. Third, it is object-oriented in a nice way (everything really is an object). Fourth it runs on the Java VM. So far, so good.
The down side to it is that the learning curve seems quite steep. I am occasionally surprised by the solutions given in the text I’m reading (the Scala book), and I think that’s bad. After reading half the book I should be able to predict the form of a solution. I’ve been doing quite a bit of functional programming recently, and so I’m not shocked by that aspect. I think it is actually the exposition, which is otherwise excellent. Too many ideas are being introduced for the first time in code snippets.
I am also frustrated that Scala uses type erasure. It’s not as much of a problem as with Java, but it is still a bit frustrating.
On the plus side I really want to write some code in Scala. I’m currently developing a class library for sequence enumeration. It’s relatively compact, but mixins would really help the library, and the Scala prompt would make testing much nicer. Right now I’m testing using Jython. The temptation is strong to re-write the library in Scala.
If anyone else has experience with Scala, I’d love to hear about it.