Revisited: No future for functional programming in 2008 – Scala, F#
In January this year I’ve written about the future of functional programming in 2008, specifically about Scala and F#. Now that the end of the year nears, I’m going to look at my predictions and see how I fare.
In 2007 lots of people claimed that this year would be the year of functional programming languages. One quote I used in my post was from the website lambda the ultimate:
“My prediction is a little bit more conservative, but I predict Scala will gain momentum, and at least one high visibility project will use Scala”.
I was more than sceptical
A safe bet, really? [...] Don’t kid yourself. There will be no rise for application and especially enterprise development in functional programming.
mostly because I’ve seen the shift for languages taking a very long time. It took decades for people to move from C-style procedural code to object orientation. And though functional languages have been around forever, they haven’t started their ascend into the mainstream yet. But there was also a curious and hopeful tone in my post nevertheless:
They both are the most promising functional candidates when it gets to momentum. The transit for C# and Java developers seems to be easiest compared to other languages.
After nearly 12 months have passed, now let’s see what 2008 brought us concerning functional programming, especially Scala – as I specifically mentioned Scala in my post and because I know most about Scala from the bunch of functional languages.
A lot has happend to Scala in 2008 for sure. Even CIO.com mentions Scala in a Scripting Language comparison:
Scala is particularly attractive to Java developers.
(not sure why they call Scala a scripting language ;-)
Some real examples have shown up. Those include the real world Scala examples by Jonas Boner and Twitter. This matches with the “a high visibility project will use Scala” prediction. Some droped Scala in their development though. What hasn’t happen in 2008 is that greater numbers of developers moved from Java to Scala or bigger numbers of developers moved to Scala from other languages. As The Disco Blog writes in a comparison between Scala and Clojure:
What remains to be seen is if they can compellingly convince the Java market to learn their way of programming rather than leveraging what’s home (i.e. the Java language) for the majority of their respective target audiences.
Often books are cited as one indicator for momentum in programming languages, which sometimes is problematic as I’ve written before. Scala has been quite successful 2008 with books. There are three, one released and two announced for 2009:
- Pragmatic Programmers, “Programming Scala”
- Artima “Programming in Scala”
- O’Reilly, “Programming Scala”
Growing pains – syntax debates
Guido van Rossum, the Python inventor, had some troubling words to say about Scala:
Perhaps my biggest disappointment in Scala is that they have so many rules to make it possible to write code that looks straightforward, while being anything but — these rules all seem to have innumerable exceptions, making it hard to know when writing simple code will work and when not.
Following one debate about Guidos post on the Scala debate list, there are many counter points raised. Sadly the bigger number of commentators want the language to stay the way it is. It seems only David R. MacIver wants to change the language to make it easier. I strongly agree with him and Guido that there are parts which are inconsistent, which need to be changed to get Scala into the mainstream.
What bothers me personally with Scala? It’s not that well integrated with Java as it could be. In my post on Clojure vs Scala I mentioned that already:
But the idea of Clojure – tight integration with Java through Iterable and Iterator, implementing Java interfaces, but keeping immutable structures, compared to Scala which creates it’s own incompatible versions, should prove much more successful. I like that definitely way better, Scala should adopt that approach.
And they should drop .NET support. It looks like nobody uses it and it hampers Java integration. Drop it.
But Guidos post has some hope in it too. Alex Paynes comment to Guidos post says:
I’m seeing more and more programmers getting real work with Scala, not musing about its theoretical possibilities. I find that pragmatism encouraging.
The success of functional programming – in this case Scala – depends on competitors. How did they do in 2008?
I see two competitors to Scala. They mainly arise from the notion of Scala as a Java successor – which is the main market for Scala I think. Not much people will come from the dynamic language camp (some who might be fed up with large Rails code bases), not much from functional programming. Most are current or former Java developers.
The first competitor is Clojure. Why? It has a big momentum and a lot of buzz. Rich Hickey seems to be an approachable, knowledgable guy who can give good speeches. He does a lot of things right. But Clojure is mainly a Lisp style language. And lots of people don’t like S-Expressions because they find them unreadable in quantities. It’s also not focusing on OO style development, when most people today agree that OO is a good way to model business problems. Scala will win over Clojure I guess.
The second, and more important competitor, is Groovy. It’s been in this space for quite some time, but with the recent aquisition of G2One by SpringSource I guess it will make a big jump into the enterprise. SpringSource has a lot of good speakers at conferences who are also quite good sales people. Groovy had some problems, but mostly adapted, made it’s syntax easier, added powerful features and got faster. The Groovy vs. Scala debate might be more about dynamic vs. static typing (see last comments by Paul and James) and might be decided by the type issue.
All in all the competitors seem to have done better in 2008, with Clojure getting momentum and mentioned pratically everywhere and Groovy with the G2One takeover.
There is still no killer application in 2008 for Scala. Ruby took a decade to get momentum. There was some momentum when I developed in Ruby at the end of the 90s (mostly by Java people who were agile and fed up with Java), but this momentum got Ruby nowhere. Rails as a killer application for Ruby let the number of Ruby developers explode. In a way that today Rails and Ruby are synonymous, very few people use Ruby without Rails.
What could a killer application for Scala look like? A Rails clone? David Pollaks Lift didn’t make it. Perhaps it’s actors or a application server build on actors (comet friendly, scalable) is the killer application for Scala. Other ideas? Mainly the lack of such an application explains the slow growth of Scala in 2008.
And in the end? I’m more optimistic about functional programming than at the beginning of 2008, although the TIOBE index for 2008 doesn’t look that promising for functional languages.
Object-Oriented Languages 57.9% +1.6% Functional Languages 2.6% +0.4%
I mostly think now OO and Functional Programming will work together in the future to write good software, and OO languages will borrow more things from functional languages. I’ll write a deeper post about how OO and Functional Programming fit together for sure.
This was a post mostly about the future and state of Scala. Wasn’t it supposed to be about functional programming? Following blogs and debates it seemed to me that other functional languages didn’t move in 2008. Erlang had some hype during the summer, which ebbed too soon. Haskell didn’t move, it’s still the promising functional language it had been for years. F# did move, but beside the promises by Microsoft I didn’t see any breaktthroughs in 2008 (perhaps I haven’t looked in the right places).
Thanks for listening. As ever, please do share your thoughts and additional tips in the comments below, or on your own blog (I have trackbacks enabled).
Update: See the impressive comment by Don Stewart about the growth in Haskell this year. Looks like real momentum, contrary to my (obviously wrong) perception ” Haskell didn’t move, it’s still the promising functional language it had been for years.”
Update 2: Good points made in comments: IDE support got much better 2008 in Eclipse, Netbeans, Intellij. Bad points: High profile googlers seem not to like Scala.