Erlang

Date Arrow  December 19, 2007

As I said before, I like to learn a new programming language every year. I also like to read at least 6 computing-related books every year, but the article about those 6 will come later.

The reason for these two rules is twofold: first, it gives me lots of material to blog about, and helps me refine my list of preferred languages :) secondly, and more seriously, learning a new programming language makes you think differently about problems. It’s not just something to keep my CV updated; it’s to challenge what I know, how I know it, and why I know it. It is important, and it’s not easy; and I’m not the only one to do it.

From all the candidates that I had for this year, I chose to learn Erlang. Here’s some of my impressions.

Erlang is a functional programming language, created by Joe Armstrong (photo) at Ericsson in the 80s. The name of the language is a pun between the name of the Danish mathematician Agner Krarup Erlang and the acronym “ERicsson’s LANGuage”. By the way, lots of things are coming from Denmark lately.

The main factor that made me jump on this wagon was that the language got a lot of attention, both in 2006 and 2007. The peak of all this buzz was a couple of days ago, when Amazon unveiled a new online service called SimpleDB, apparently built with Erlang. The reason for this is Erlang’s inherent capability to handle massively parallel programming relatively easily. In Erlang you can create lightweight processes, each sending messages to the others, and thus divide your problems in small units that run concurrently.

Even more buzz, the release of the Pragmatic Programmer’s book about Erlang (written by Joe Armstrong himself) has added a strong factor to the recent popularity of the language.

1358541112_ebcc499c91.jpg

How to start with Erlang?

  1. Get it working on Leopard using MacPorts;
  2. Activate the Erlang language support in TextMate;
  3. Follow a quick tutorial to get the idea;
  4. Check out the Yaws web server build on Erlang, apparently much, much stronger than Apache under high load!;
  5. Download, install and play with ErlyWeb, an MVC framework similar to Rails;

More interesting reading (and viewing) about the language:

My del.icio.us link list about Erlang will keep growing… subscribe to the RSS feed to get updated of new entries on your favorite reader.

In spite of some opinions that I have seen about Erlang so far (please check a question I’ve asked at LinkedIn about it), I have found this language extremely interesting; and at the moment, my list of known programming languages goes like this:

  • 1992: QBasic; it came bundled with my first PC!
  • 1993: Turbo Pascal; it was part of the official curriculum in the University of Geneva.
  • 1994: C; my first contact with the bracket syntax.
  • 1995: Delphi; I preferred more the Pascal syntax at that time… and it was an amazing environment to work with.
  • 1996: Java; everybody was talking about it at the time! You couldn’t miss it.
  • 1997: JavaScript; adding interactivity to web pages was the coolest possible thing to do at the time!
  • 1998: VBScript; that’s when I started working with MS’ ASP technology;
  • 1999: Transact-SQL; those ASP pages were talking to a SQL Server 6.5 in the background…
  • 2000: C# and Prolog; the first was the coolest thing since sliced bread (remember the technology previews back in August 2000?), and the second, part of the official curriculum at the Universidad de Buenos Aires…
  • 2001: C++; I had to learn it. It’s a major step in anyone’s career.
  • 2002: PHP; my jump to the open source world started here…
  • 2003: Objective-C; after I became a “switcher”, I installed the free developer tools that came with Mac OS X… and never looked back!
  • 2004: Visual Basic.NET; stuff that some clients required me to learn… geez.
  • 2005: Ruby; my flirting with Rails started that year.
  • 2006: LINQ; a language inside a language: or how to use C# to filter collections in-memory as if they were small databases…
  • 2007: Erlang; here I am now!

Tagged   Code · Opinion

13 Comments

  • #1.   Reg Braithwaite 12.19.2007

    Thanks for the link. Good luck with your journey of discovery.

  • #2.   adrian 12.19.2007

    Thanks Reg! :)

  • #3.   the_dormant 12.20.2007

    My list :
    - 2001: C++ used it only in a bundled Visual Studio mode
    - 2002: Java
    - 2004: Here, the learning fanatic in me was unleashed after reading “from journeyman to master” Pragmatic Programmer’s book
    -2004: Ruby, Python, Common Lisp
    -2005: Erlang, Smalltalk, Scheme, Dylan
    -2006: Haskell, Oz, Perl(5,6), OCaml, Objective-C(Cocoa)
    -2007: Scala, Coq, Isabelle/HOL, SML, JoCaml, Factor, Forth
    -2008: I’m willing to learn Prolog, and probably working through SICP or AIMA with Factor(it was for me the most mind bending language, next to Haskell). Epigram, R(statistics) and Assembly are also on my learning list too.
    Note that I was never interested in learning C#. But if I have to work on a windows environment again I’d rather pick F#.
    And yeah, there’s still a lot to learn and life is short. My actual investment is on a more wider algorithms and data structures catalog, on artificial intelligence and maths.(While still doing SOA/Java and things that don’t deserve to appear on this page)

  • #4.   Ricardo Herrmann 12.20.2007

    Sounds like fun … my turn:

    1980: Born without a clue about programming
    1986: MSX Basic
    1993: z80 assembly
    1994: x86 assembly, QBasic
    1997: Serious x86 assembly (it all really starts here: protected mode, MMX, FPU)
    1998: Tried to learn Pascal by myself without success
    1999: C, C++
    2000: Java, Perl, Bash (started working)
    2001: ASP, PHP
    2002: C++ for real (template metaprogramming included)
    2003: Octave
    2004: OO Perl, Python, Ruby (all look the same)
    2005: (Bored to death, dealing with too much web programming, way more than should be considered healthy, so no new languages this year)
    2006: Prolog (hmm, there’s a different world out there)
    2007: Haskell, Erlang and Common Lisp (the year of the enlightenment)
    2008 (expected): Scala, Oz, Curry, maybe Epigram and Coq too (and be exhausted and wise by then)

    Basic has left my neurons a long time ago by now … Dijkstra was wrong ;-)

  • #5.   adrian 12.20.2007

    the_dormant and Ricardo: you’ve convinced me! Scala will be the one for 2008 :) I think I’ll start by reading n8han’s article on it.

  • #6.   Ricardo Herrmann 12.20.2007

    The motivation for learning Scala comes from the following:

    * Once you learn a more expressive languages you won’t go back to “code as usual”
    * Everyone around you uses Java and you don’t have the time to rewrite the damn libraries and frameworks
    * Scala’s mapping of functional programming paradigms to the JVM seem efficient enough
    * It has XML built-in into the language, basically for making it easier to sell it as enterprise-friendly ;-)

    Although there’s also CAL, from BusinessObjects … “Haskell” for the JVM, and in active development. Seems like it does things in a novel way, not even being being a port of the spineless tagless G-machine to a JVM as a first Java backend for GHC would be expected … haven’t checked these topics enough though.

  • #7.   Ricardo Herrmann 12.20.2007

    Of course, I forgot mentioning Scala Actors, a subset of Erlang-style concurrency for the JVM, else I’d be missing the point of commenting on this post ;-)

  • #8.   adrian 12.20.2007

    :)

  • #9.   Bob 12.20.2007

    Scala is a poor man’s Erlang.

  • #10.   Steve Walker 12.21.2007

    I’ve just started looking into erlang also, looks like a great language for the multiple cores that have become so prevalent. You may be interested in fuzed also, a rails/yaws integration gem. It’s still alpha I believe, but I wonder if it will become the preferred stack for rails at some point.

  • #11.   Tim Dysinger 12.21.2007

    Sapir-Whorf, baby! Language expands the mind.

    http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis

  • #12.   links for 2007-12-21, or so says Harry Love 12.21.2007

    [...] Open Kosmaczewski - Erlang (tags: erlang tutorials) Tags: Found Objects [...]

  • #13.   links for 2008-06-06 at Topper’s Blog 06.06.2008

    [...] Open Kosmaczewski - Erlang (tags: erlang howto blog install getting started gettingstarted) [...]

Commenting