My experiment with Scala is not working out. It’s just not ready for prime time, and is overkill for my needs. Reluctantly, I am falling back to Java.

Scala is a tour de force of language design. In my mind, it is two languages in one. First, it is a clever fusion of OO and strict functional programming (ala ML). For those coming from OO, I think it is a more natural fusion than that of OCaml & F#. Secondly, it is the ultimate language to date for writing libraries and embedded DSL’s with static types. Many things that are specialized syntax in other languages are just library code in Scala. You can warp the syntax to many uses, all within a static type system. Libraries can be modularly extended and composed without modifying their sources. These abilities go way beyond any prior statically typed language.

The problem is that these abilities come at a high cost in complexity. The syntax has so many ways of doing things that it can be bewildering. As with Macro-based languages, you are always a little uncertain about what your code is really doing underneath. The type system is just too complicated for me. The docs include “use cases” that approximate the real types to make them simpler and more understandable. That pretty much says it all.

If you need to build big complex libraries for a large group of application programmers, this might be a good tradeoff. But I don’t need to do that. All I really want is the nice simple part of the language that cleans up Java and gives me first class functions and algebraic data types and pattern matching. For me, that part of the language is 80% of the benefits and 20% of the complexity. I predict someone will do a “ScalaScript” that hits that sweet spot, but which compiles to JavaScript instead of Java.

I mostly wanted functional programming because it is a powerful way to do parsing and compiling. But I have decided to try Stratego/XT for my parsing and compiling instead.

Actually I could live with all of the above problems. The killer problem with Scala is that the tools are just not ready for prime time. The Eclipse plugin is a total fiasco. They have been working on it for years, with not much progress to show for it. They are screwed because Eclipse won’t add hooks into the JDT for them. IntelliJ is way ahead, but still has a long way to go to be production quality. The scala compiler is agonizingly slow. They have a “fast” compiler that runs preloaded in a daemon, but it mysteriously dies every 30 minutes or so. I hit my final breaking point when I wanted to debug one of my unit tests. Intellij doesn’t let you set breakpoints in tests. So I arrange to catch the assertion exception and I am warped into a bizarro world where everything has been mangled and boxed and thunked and I can’t find any of my variables.

I wish Scala the best of luck, but I have work to do.