Wednesday, August 11, 2010

Martin Odersky's new company ScalaSolutions

The creator of the Scala programming language, Martin Odersky, stated informally at Scala Days 2010 that he intended to create a startup offering commercial Scala support. He also mentioned it in a comment here. Interestingly, a venture capital firm in Switzerland have listed ScalaSolutions as a new company with VC funding and Martin Odersky as CEO/Chairman that describe themselves as:

A company to provide support, consulting, training, and enterprise tools for the open source Scala programming language.

Thursday, April 1, 2010

10,000 copies of Programming in Scala sold

The first book on Scala Programming in Scala that was published Q3 2007 has apparently sold over 10,000 copies according to a recent mailing list post by one of its authors, Martin Odersky.

This is far more copies than all functional programming books combined in 2008. For example, F# for Scientists has sold only 2,500 copies and sales have completely dried up after less than 2 years.

Sunday, February 8, 2009

Tail calls on the JVM: work in progress

The terms proper tail recursion and tail call elimination are used to describe the ability for a computation to flow through an arbitrary number of functions via tail calls in a bounded amount of stack space. Consequently, correct implementation of tail call elimination has been regarded as an essential feature for functional programming languages for over two decades. Without it, many functional idioms are prone to causing stack overflows.

Microsoft's .NET platform is built upon a Common Language Run-time (CLR) that was designed to support a wide variety of programming languages including functional languages and, consequently, the CLR has had tail call elimination for the best part of a decade. There are already several commercial products that depend upon the correct handling of tail calls in the CLR.

Although the JVM has many advantages and is the VM of choice for millions of developers, the lack of support for tail call elimination on the JVM has seriously impeded the development and uptake of functional languages like Scala and Clojure and that has, in turn, greatly reduced the diversity of tools and solutions available on the JVM.

Sun have been making noises about implementing tail call elimination in the HotSpot virtual machine for years but there had been no visible signs of progress until Arnold Schwaighofer's announcement on the OpenJDK mailing list a few weeks ago stating that he had successfully implemented tail call elimination on the JVM.

This is very exciting news and represents the single most important step the JVM has ever made toward being a genuine common language run-time. If support for tail call elimination makes it into the JVM then both existing and new functional languages (such as OCamlJava) will no doubt see vastly more interest as they will be infinitely more suitable for writing production quality code.

Saturday, December 22, 2007

First book on Scala just published

Artima just published the first book on the Scala programming language called Programming in Scala, written by the language's creator Martin Odersky as well as Lex Spoon and Bill Venners.

Some of the keenest readers have even posted their reviews. David Pollak writes "I heartily endorse buying the book and think it's a spectacular piece of work". Eelco Hillenius writes "I love the book so far. Definitively the missing piece of getting started with Scala. Thanks!".

Congratulations to the authors and the Scala team for achieving this milestone!

Saturday, October 13, 2007

Deferring evaluation

One of the first cool features of the Scala language that struck me is the ability to defer the evaluation of a function argument simply by changing the type of the function definition.

In essence, you simply take an existing type declaration for a function argument of a given type:

def succ(x: Int): Int = 1+x

and insert => to defer the evaluation of the expression:

def succ(x: => Int): Int = 1+x

Now, evaluation of the expression passed to succ is deferred and each reference to x in the body of the function succ actually evaluates the given expression.

Kent Tong recently gave a good practical example of how this can be used to defer the computation of debug expressions. This addresses a common problem where computing debug strings too eagerly can slow down a whole application significantly even if the debug strings are never logged!

Sunday, October 7, 2007

Flying Frog move into Scala market

We posted a note that our ray tracer had been ported to Scala and asked if anyone would like a new book Scala for Scientists following on from our OCaml for Scientists and new F# for Scientists titles. The response was tremendous!

Needless to say, we're now diversifying into the Scala market and you'll most likely see a lot of free example demos and commercial Scala/Java products from us in the near future.

For us, the most interesting thing about Scala is the fact that it builds upon the Java legacy. Our area of expertise is technical computing (how computers can benefit scientists and engineers). We started out with C++ but quickly discovered the benefits of modern statically-typed functional programming languages of the ML family (primarily OCaml).

However, these languages are obscure compared to mainstream languages like C++, Java and even (in technical computing) good old Fortran. One obvious problem with this is lack of libraries. OCaml has a lot of libraries and, compared to mainstream languages, the libraries that exist for OCaml are of incredibly high quality. However, the world keeps changing and OCaml lacks libraries to deal with many recent inventions like web services (SOAP, UDDI, WSDL and so on).

The easiest solution to this problem is to build a new generation of functional programming languages on top of existing platforms that already have big user bases. Fortunately, efforts are underway to bring state-of-the-art programming languages to both of the major cross-language platforms. The F# programming language from a team led by Don Syme at Microsoft Research targets their .NET platform and the Scala programming language from an academic group led by Martin Odersky at the EPFL in Switzerland targets the JVM.

The .NET platform is a wonderful thing: designed to support multiple languages (the Common Language Run-time) and often more efficient than the JVM. However, for all intents and purposes, .NET means Windows only. Microsoft have the functional programming on .NET market pinned down with F# and they just switched on the development afterburners (expect a major announcement soon!).

That leaves the JVM. Java is the primary language for the JVM and has shot to super-stardom in recent years, becoming not only a dominant force in web programming but also technical computing and many other areas. Java is now widely used by scientists and engineers and is a particular favourite among bioinformaticians, not least because the JVM runs on Linux, Mac OS X and Windows. This is of particular interest to us because dozens of bioinformatics institutes across the world have bought our book OCaml for Scientists. Although the JVM was not originally designed to support multiple languages, several major new languages have been built on top of the JVM (e.g. JRuby and Groovy) and there has been much discussion about augmenting the platform with features (like tail recursion) to help the development of new languages.

We have no doubt that F# is about to make serious inroads into technical computing on the Windows platform, and will even draw in users from other platforms. However, if the purpose of building upon an existing framework is to exploit its popularity, then we must consider how popular the dominant languages for each framework are. In general, the popularity of Java and C# is quite close, with most users working on web programming, database programming and GUI application development. However, among technical users, Java is vastly more popular than the whole of .NET. In fact, the number of technical users of C# is similar to the number of technical users of OCaml. We learned this the hard way by releasing an FFT library for .NET before surveying the market properly, only to discover that it is only as popular as our Visualization library for F#.

F# is set to explode in popularity over the next three years and the vast majority of technical users on the Windows platform will migrate to F#, followed by many non-technical users. Scala has the disadvantages of a much smaller development group and no advertising budget but the advantage of growing on top of a vastly more popular platform. So we believe that both projects are about to reshape the programming language landscape. We just completed F# for Scientists. Now its time for Scala for Scientists!