Sunday, November 30, 2008

Writing the Scala serialization benchmark I did a Java to Scala calls. It is very simple, just as using a yet another Java library. You only need to add the Scala library jar into your classpath and you're ready to go.Alas there where to small but nasty quirks

Scala's List is not a Java Collection list. Actually I could not create a Scala list since its abstract. Scala is using lists heavily and its list is very powerful. Still it sucks that you can't easily create a Scala list in Java and set it in a Scala object. Obviously there are easy ways around this problem.

The second is that Scala's enum is not a Java enum. It has many implications when trying to use a library written in Scala.

@Itay, I agree. You can make a list immutable of course (Collections.unmodifiableList), but that would be missing the point :-)

It would be nice to have a Scala/Java utils library for java code that needs to use Scala list for language interoperability or just because its nice. List$.MODULE$.fromArray looks too much like hacking or using unsupported implementation.