Wednesday, 19 September 2007

The future is bright for functional programming

Given the recent surge in interest, several companies have expressed a desire to create product lines centered around various functional programming languages. Although there are still a relatively small number of companies generating revenue from functional programming, we have found it remarkably easy to create successful products in this area. Naturally, Flying Frog have many fingers in many pies and we find it very encouraging that the functional pies have turned out to be the most efficient at creating money time after time.

OCaml remains our most profitable functional programming language, with our book OCaml for Scientists and The OCaml Journal currently accounting for 67% of our revenue from product sales.

F# is our second most profitable language, with sales of The F#.NET Journal and F# for Visualization accounting for 28% of our current sales.

However, the growth of functional programming languages is most interesting. Following a four-fold increase in sales of all OCaml-related products over the year to April 2007, we are now seeing a plateau. Although development of the OCaml language itself has slowed, we believe this will not deter industry from continuing to adopt the OCaml programming language. Indeed, XenSource are one of the largest commercial users of OCaml and the company recently sold for $500M.

Interest in F# is now exploding. Our F#-related products are all new so we cannot derive long-term trends from sales but we have seen a four fold increase in search engine referrals from searches for F# over the past six months alone. We believe that interest in F# will grow even faster because we are predicting the imminent productization of this language by Microsoft.

Overall, functional programming in industry is clearly going from strength to strength. The oft-cited advantages of functional languages no doubt underpin this but the advent of multicore computing is an unquestionable driving force that tips the balance for many talented startups wanting to create future-proof solutions for their customers.

The future is bright for functional programming languages on all platforms. We shall certainly continue work related to OCaml and F# and may even diversify into other functional languages such as Scala or Haskell.


Robert said...

What's interesting to me is that the Haskell rage seems to have died down, and been replaced by an Erlang rage. Now, Erlang is a dynamically-typed language, which makes it more palatable the mainstream enterprise vogue (c.f. JRuby/Groovy), and the distributed stuff is a cute trick. But it still feels faddish to me.

Enterprise developers seem to be searching into the functional realm (thank God), but they don't seem to be finding. Now, they by and large haven't tried on OCaml or F# yet, but I wonder what it is they keep feeling like they're missing?

Jon Harrop said...

I agree with what you're saying, Robert, but I think you need to break those programmers into academics, industry and dabblers before you can make sense of the statistics.

In academia, computer scientists have been using functional programming languages to write production code since time began (Lisp). The physical sciences have been extremely slow to adopt better approaches to programming and this is one of the problems I aim to solve with OCaml for Scientists. There is almost no money in this market. Our academic discounts are purely altruistic and make no business sense.

Industrial use of functional programming languages is very different and very interesting. OCaml is already widely used in many different areas of industry, with major backers from systems programming (XenSource) to finance (Jane St.) and even Microsoft. Although Haskell has more books, roughly twice the population and better Windows support than OCaml, it seems to be much less common in industry (only Credit Suisse and they are moving to F#). JavaScript is certainly hugely popular in industry but Scala and F# are still catching on. Although Erlang was born in industry, its use remains specific and there is certainly a perception that it is not a general purpose language. In this market, profit margins are wide. Most of our customers and the vast majority of our revenue are from this market.

There are far more dabblers interested in functional programming languages and functional techniques than ever before. These guys buy lots of cheap mainstream-published books like Practical OCaml and want to hit the ground running with simple explanations and sexy demos. The people learning Haskell last year and Erlang this year are the dabblers. I believe they learn simply to better themselves. Although there are many such people, there is little money to be made in this market and the profit margins are narrow. Some of the dabblers may affect the uptake of languages in industry but I believe this effect is small.

A silent but pivotal effect in this ecosystem is the power of the CV (resume in American). Or, more precisely, the perception of it. If ordinary developers perceive that learning functional programming languages will let them get the higher-paid and more rewarding jobs then they will swarm to functional languages. With an increasing number of FP jobs being advertised, this has already started to change but I believe we will see a major change in this respect over the next three years.

KissTheGoat said...

My tentative opinion is that Scala hits OCaml right in the googlies; it's fully OO, yet is functional with a state-of-the-art static type system, has an Erlang-like Actors module. And it's born with full Java and .NET compatibility (all those libraries!). When it becomes stable enough to merit a book, I dunno, I can't see why it won't grab up the many strands of interest and sweep a lot before it.