Scala lift-off with liftweb
April 4th, 2007What Rails did for Ruby had been at least started by the Lift Web Framework for Scala! It is Version 0.1.0 but it looks promising. Their website runs on liftweb, too - in fact they are running the example you can download and deploy on your Appserver. Behind liftweb are David Pollak and (among others) Burak Emir how contributed the XML-handling to Scala.
I had a brief look at the code; liftweb is based on Scala-Actors (the Scala implementation of the famous programming model made widely known by Erlang) which promises that it will be quite scalable.
This gave my Scala engagement another boost. And a setback. I installed the latest plugin for Eclipse (it is and had been always quite shaky) - good news: It comes with the compiler/runtime, bad news: It is the 2.3.4 version (current version is 2.4.0) and the preferences page has a bug that prevents you to set the path of your Scala installation.
Scala is for me quite interesting as it also allows to compile to .NET IL-code. This gives Scala a quite unique position as a language that allows you to write code for the two platforms once and run it on both of them.
Another feature that is nice is actually the only pain-point I have yet identified: Scala requires only Java 1.4 - good for people which are still stuck with that version, but bad for the rest of us:
Using implicit functions you can write
val list:List[Any] = MyJavaClass.getCollectionOfString()
But even if getCollectionOfString returns Collection it is impossible to write a conversion that allows to give list the type List[String]. Reason is that the implicit functions for the conversion would need a type parameter and Scala rejects a declaration
implicit def JavaCollection2List[T](coll : java.util.Collection[T]) : List[T] ={…
because “java.util.Collection does not take type parameters”.
If you think this is not an issue: Try dealing with a Map,List>… all this casting gets pretty ugly as casts are rare in proper Scala code, consequentely you get punished for doing it anyway by nice syntax obj.asInstanceOf[String]…
