Site Archive (Complete)
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
July 18, 2007
Programming Erlang

Jonathan Erickson
Not just 'fault tolerant' but 'highly fault tolerant'

Joe Armstrong had fault tolerance in mind when he designed and implemented the Erlang programming language in 1986, and he was subsequently the chief software architect of the project which produced Erlang/OTP, a development environment for building distributed real-time high-availability systems. More recently Joe wrote Programming Erlang: Software for a Concurrent World. He currently works for Ericsson AB where he uses Erlang to build highly fault-tolerant switching systems.

DDJ: Joe, what's unique about Erlang as a language? Why do we need a language like it?

JA: Erlang is a concurrent functional programming language. Basically there are two models of concurrency:

  • Shared state concurrency
  • Message passing concurrency

Virtually all language use shared state concurrency. This is very difficult and leads to terrible problems when you handle failure and scale up the system.

Erlang uses pure message passing concurrency. Very few languages do this. Making things scalable and fault-tolerant is relatively easy.

Erlang is built on the ideas of:

  • Share nothing. (Process cannot share data in any way. Actually, this is not 100% true; there are some small exceptions.)
  • Pure message passing. (Copy all data you need in the messages, no dangling pointers.)
  • Crash detection and recovery. (Things will crash, so the best thing to do is let them crash and recover afterwards.)

Erlang processes are very lightweight (lighter than threads) and the Erlang system supports hundreds of thousands of processes.

It was designed to build highly fault-tolerant systems. Ericsson has managed to achieve nine 9's reliability [99.9999999%] using Erlang in a product called the AXD301. [Editor's Note: According to Philip Wadler, the AXD301 has 1.7 million lines of Erlang, making it the largest functional program ever written.]

DDJ: So are programmers really using Erlang in the real world, or is it solely of academic interest?

JA: Absolutly. Commercial use is far greater than academic. It was developed at the Ericsson Computer Science Lab for building fault-tolerant systems. It's used by Ericsson in a number of products.

Outside of Ericsson, Erlang is used by a number of start-ups for building high-performance servers. Most notably ejabberd which is a jabber server. This is probably the best featured and fastest free jabber server on the market, it's being used as a back-end in a lot of products.

Some pretty fast-moving startups in the financial world have latched onto Erlang; for example, the Swedish www.kreditor.se. Erlang gives them a great commercial advantage over their competitors.

DDJ: It seems that, what with multi-core processors and the like, we're rapidly approaching the day of commodity parallelization. When you designed Erlang in the 1980s, did you ever expect parallel systems would be a commodity, or did you see it as primarily a language for high-performance computing only?

JA: It was never a language for high-performance computing. It was a language for building fault-tolerant distributed systems. Ericsson has always used parallel hardware in its switching products -- right from the AXE in the mid 1970s. There is a "school" of parallel programming inside Ericsson. Erlang is the third language in a progression of languages: PLEX -> Eri-Pascal -> Erlang.

The Erlang philosophy was always to build system with lots of cheap processors and allow them to fail. We don't prevent failure; we live with it and recover when failures occur. That's what Erlang was designed to do. That's why there is "no shared state". Shared state and failure are ill-suited bed-fellows.

Today multi-cores are really like "distributed system on a chip" with very high-speed message passing. Since we have share-nothing and concurrency, Erlang programs map beautifully onto multi-cores. Ericsson is shipping products on dual-cores that run virtually twice as fast as the uni-cores with only tiny changes to the code.

DDJ: In addition to your book Programming Erlang, can you point readers to websites where they can find out more about this most interesting programming language?

JA: Yes, there is the Open Source Erlang site at www.erlang.org which, among other things, includes the full source code of the current Erlang system. Then there is the Erlang community site at www.trapexit.org.

TOP 5 ARTICLES
No Top Articles.
DR. DOBB'S CAREER CENTER
Ready to take that job and shove it? open | close
Search jobs on Dr. Dobb's TechCareers
Function:

Keyword(s):

State:  
  • Post Your Resume
  • Employers Area
  • News & Features
  • Blogs & Forums
  • Career Resources

    Browse By:
    Location | Employer | City
  • Most Recent Posts:
    MEDIA CENTER  more
    NetSeminar
    Creating Common and Scalable SOA Solutions for the Enterprise Leveraging an Enterprise Service Router (ESR)
    Creating Common and Scalable SOA Solutions for the Enterprise Leveraging an Enterprise Service Router (ESR) Despite the many emerging instances of SOA today, the ability to leverage common services and a common metadata layer in a secure and scalable manner is paramount, but rarely addressed. In this webinar, Intel discusses the core issues and opportunities behind the quest to provide a common services and information management layer, and explore a new architectural component called an Enterprise Service Router. Thursday, November 13, 2008. 11AM PT/2PM ET
    Next Generation ALM: Automating the Entire Build and Release Process
    As more and more software development shops adopt Agile processes, fully automating the build and release management processes becomes a critical element of Application Lifecycle Management (ALM) strategy. Join Forrester Senior Analyst Jeffrey Hammond and Anders Wallgren, CTO from Electric Cloud, as they discuss release management best practices and how to get started. Wednesday, November 19, 2008. 11AM PT/2PM ET
    Pain Relievers for Continuous Integration and Agile Development
    You're the build manager. You actually build the product that ships. Yet you get no respect. You're on your own to build your toolset. You're expected to provide a Continuous Integration environment - even though you have developers all over the world and a build that takes 14 hours to run. You're expected to be agile. Learn how in a Free webinar on December 3rd at 11am PST from Electric Cloud. Wednesday, December 3, 2008. 11AM PT/2PM ET
                                   
    EVENTS

    Nominations for the Jolt Awards - the “Oscars” of the software development industry - are now open!
    INFO-LINK

    Resource Links:




    Related Sites: DotNetJunkies, SD Expo, SqlJunkies