Meditations on programming, startups, and technology
New Relic

The Rise of the Functional Paradigm

LambdaIn yesterday’s address to the Ruby community, Dave Thomas invited Rubyists to fork Ruby, to freely research and experiment with new and interesting features. If this process is successful, many of these features will inevitably see their way back into Ruby’s core, thus improving the language in leaps and bounds. And I feel he couldn’t have been any more right. In fact, the whole industry is experiencing the trend of incorporating features developed in less common languages, research languages, “toy languages” if you prefer, within mainstream ones.

Experimenting with these alternative languages is important because occasionally they themselves become widely used, and even when they fail to do so, they lend their insight to the world of software development, finding their way into other languages. This approach greatly accelerates the development of common languages for the good of their large user bases and the improvement of the software industry. It’s a win-win situation for everyone involved and for the development community as a whole.

Pay attention to the development community online, and you’ll quickly notice a few non-mainstream programming languages appear over and over again. I’m referring to languages like F#, Erlang, Haskell, Scala and Clojure. I’ll admit to a certain selection bias, given that I tend to hang out in communities where hackers and developers actively pursue the betterment of their programming skills, beyond the stereotypical 9 to 5 requirements. But nevertheless, three or four years ago the average developer probably wouldn’t have heard about any of them (at least the ones that existed at the time). And today all of these languages have active communities, books being published about them, and most programmers have at least encountered some of these names.

They are all different languages, but their common denominator is the functional paradigm. Notice that I titled this post “The Rise of the Functional Paradigm” and not “The Rise of Functional Languages”. In a sense the latter is true as well, since there’s been much more attention towards functional programming languages lately. But there is a subtle difference. I don’t expect purely functional languages to become the most used programming languages anytime soon. For the foreseeable future, I don’t predict US companies to outsource Haskell jobs to India or China, like they do today for Java or .NET projects.

Yet these functional languages serve a higher purpose. Not only do they satisfy the needs of intellectually curious developers and companies looking for a competitive advantage, but they also have a great deal of influence on the rest of the development world.

We are seeing a convergence between these two groups of languages. Functional languages will strive to become as useful as possible, with libraries and tools that are more adequate for mainstream developers, while conserving their functional purity (I’m looking at you almighty Haskell). Meanwhile, mainstream languages will slowly adopt powerful features found in these functional and other research languages, adding further expressiveness and capabilities to their largely adopted foundations. F#, the evolution of C# and the addition of LINQ should be enough evidence that this is the case at least for the .NET platform. And even C++0x and D are leaning towards the incorporation of some functional features (e.g. lambda expressions and closures). The two types of languages come from different directions but will reach a similar destination.

The ever increasingly popular Ruby, Python and JavaScript owe their success to several factors. And while they are considered multi-paradigm and were mostly aided in their popularity by their immediacy, simplicity, usefulness and a set of historical circumstances, they’re all hybrid languages that adopt functional features. The functional paradigm is becoming so common, that it’s hard to imagine seeing any new programming language rise to fame without including at least a subset of the features available in other functional programming languages. As developers, we’ve grown to expect the elegance of functional features in a language. No lambda, no party.

If the 90s were characterized by the rise of the Object Oriented paradigm, and this decade can be considered as a transition phase, then the future belongs to the functional paradigm. Whether developers prefer to mix this with other paradigms (e.g. in languages like Ruby, Python, C#, etc…), like a powerful cocktail, or shoot it straight down (e.g. in purely functional languages like Haskell), the functional paradigm is here to stay.


If you enjoyed this post, then make sure you subscribe to my Newsletter and/or Feed.

receive my posts by email

7 Responses to “The Rise of the Functional Paradigm”

  1. Nuno says:

    At my university the first kind programming paradigm we learn is functional. That makes a difference. It’s a tool to think the problems differently. It’s a way of seeing things, to see multiple solutions to the same problem and understand what makes one better than other for a specific purpose. It’s the correct way to learn to be a good developer (I have a nice Portuguese post on the subject that had a lot of feedback).

    Anyway Haskell is not a joking language. I developed good applications in few lines of Haskell. I did a perfectly good looking sudoku application with the notion of strategy to solve a puzzle that could solve any normal puzzle in less than a second. It could solve the hardest possible sudoku problem (only one solution with 14 digits visible) in less then 5. Then the expressive power is huge. Lasy eval is also great for some tasks. And don’t forget how it’s so widely used in research. Haskell is all around in research.

    Let me even tell you a little secret. I love ruby cause i need java to code for a company cause haskell won’t ever be mainstream (it’s just not that easy). but i would love to code haskell. everything. it’s so good. lamdba, compreension lists, recursion, catamorphisms. It’s awesome.

    So in ruby i get what i need to make it work and understandable to others and still use some of the Haskell goodies winning the dynamic flavor. I’m just glad that languages like ruby showed the world the good parts on functional :)

    BTW, you might have noticed I liked your post :) Keep them coming :)

  2. I can’t honestly see decades of research into object-oriented programming being thrown out with the bathwater.

    The many significant problems of object-oriented programming were resolved years ago, but haven’t found there way out of the research labs yet! This is supremely unfortunate. Perhaps if people were more aware of this research they wouldn’t be so inclined to see functional programming as the future.

    As it stands object-oriented languages aren’t as enticing as functional languages, and how could they be? These object-oriented languages embody the problems and limitations that existed at the dawn of the paradigm! That’s not to say that they’re bad language, they’re just based on tired ideas.

    I don’t believe that the adoption of good ideas originally found is X constitute the rise of X. The adoption of good ideas is inevitable in any situation where the idea is widely known.

    Smalltalk was arguably the first purely object-oriented language. What’s interesting is that Smalltalk has always had “lambda and closures”. Smalltalk isn’t functional or even multi-paradigm: it’s purely object-oriented.

    Supporting feature set Z shouldn’t influence the classification of the language. The push to classify languages based on their support for Z isn’t only poorly thought out, it’s potentially damaging and I urge you: please stop it! Lest we label all new languages multi-fucking-paradigm, a term which conveys no meaningful information!

  3. Jeff says:

    I must admit that I’ve never really given Ruby much of a look, but I do agree with you that functional programming seems to be on the rise. List comprehensions in Python are really nice.

    I studied SML in a languages course a couple of years back, and I loved it. I remember having a lot of features in SML that I would have loved to have had in C++. A lot of them weren’t even functional specific features, rather they were features that had been researched and added to languages in recent years. Right now, I’m studying Lisp, and enjoying that as well.

  4. JD says:

    I agree.

    Fork Ruby!

    -jd

  5. Dave says:

    Maybe rather than thinking about “objects vs. functional” the real win would be looking for “objects *and* functional”.

    I suggest Common Lisp. One of the most powerful object systems. Functional if you want to program that way. Imperative when you don’t.

    That said, Ruby is my favorite backup language. ;-)

  6. Haskell opens up the mind. It’s a great language, and very interesting to play with. Functional programming is influencing most languages.

    Great post.

  7. Joshua says:

    Wonderful post! I love the underlying idea in your article, that we are in the golden age of the functional paradigm.

    I recently discovered Clojure and am in love with Lisp. I started programming with Perl in 2007, which I enjoyed very much. Then came Java and I’m still working on my OO proficiency, but somewhere along the line, things stopped being as much fun as they could be.

    Functional programming makes coding interesting all over again! Wooooohooooooooooooo!!!

Leave a Reply

I sincerely welcome and appreciate your comments, whether in agreement or dissenting with my article. However, trolling will not be tolerated. Comments are automatically closed 15 days after the publication of each article.

Copyright © 2005-2014 Antonio Cangiano. All rights reserved.