Slashdot Mirror


Erlang's Creator Speaks About Its History and Prospects

Seal writes "Erlang, originally created at Ericsson in 1986, is a functional programming language which was released as open source around 10 years ago and flourished ever since. In this Q&A, Erlang creator Joe Armstrong talks about its beginnings as a control program for a telephone exchange, its flexibility and its modern day usage in open source programs. 'In the Erlang world we have over twenty years of experience with designing and implementing parallel algorithms. What we lose in sequential processing speed we win back in parallel performance and fault-tolerance,' Armstrong said. He also mentions how multi-core processors pushed the development of Erlang and the advantages of hot swapping."

48 comments

  1. Facebook's Use of Erlang by miller60 · · Score: 5, Informative

    Erlang is used in Facebook Chat, which just hit 1 billion messages a day. Eugene Letuchy discussed Facebook's use of Erlang at the Erlang Factory event.

    1. Re:Facebook's Use of Erlang by Anonymous Coward · · Score: 0

      wow

    2. Re:Facebook's Use of Erlang by Anonymous Coward · · Score: 0

      It's even used at NOKIA in their own MapReduce implementation. See disco project: http://discoproject.org/

  2. The power behind CouchDB by slim · · Score: 4, Interesting

    I notice that CouchDB makes a big deal of its Erlang based core -- essentially "this part is trustworthy and parallelises well because it's in Erlang".

    I also notice Joe Armstrong (or more likely a transcriber) is as bad at spelling "lose" as the rest of the internet...

  3. CSP makes parallel programming easy by TheRaven64 · · Score: 5, Interesting

    Describing Erlang as a functional language is true, but misleading. It's not a pure functional language, because there is a (mutable) process dictionary. When you call something a functional language, it implies a language modelled on Lambda Calculus. The fact that functional languages do not allow side effects (Erlang does via the process dictionary) means that they are relatively easy to parallelise implicitly. Erlang adds support for the Communicating Sequential Processes (CSP) formalism on top of a mostly-functional core language.

    CSP is a very clean and simple model for describing parallel algorithms. The language enforces the restriction that no data may be both shared and mutable. The only mutable object in Erlang is the processes (which has a dictionary and some execution state). Everything else is immutable. This makes it trivially easy to write code that uses a few tens of thousands of Erlang processes (or more). These are implemented as (very) light-weight threads on top of OS threads and can easily scale up to a large number of processors, or even cluster nodes. The asynchronous aspect of the message passing means that it is not very difficult to write code that scales well across a cluster; bandwidth can be an issue, but latency generally isn't in asynchronous code.

    --
    I am TheRaven on Soylent News
    1. Re:CSP makes parallel programming easy by TwistedSquare · · Score: 3, Informative

      Erlang is based on the ACTOR model, not CSP. The main practical differences between Erlang and CSP is that Erlang uses asynchronous dynamically-typed messages sent to a particular address (process id), whereas CSP systems usually deal with synchronous messages sent down a particular, typed channel. But they are both message-passing systems with the idea of removing shared mutable data, as you say. For an implementation of CSP in the pure functional language Haskell, see my library CHP (http://www.cs.kent.ac.uk/projects/ofa/chp/).

    2. Re:CSP makes parallel programming easy by Pinky's+Brain · · Score: 1

      CSP = synchronous.

      Erlang works well, but it does not allow as easy automated model/deadlock/etc checking as CSP based languages.

    3. Re:CSP makes parallel programming easy by dumael · · Score: 1

      There's also the (D)ETS, (disk) erlang term storage, which gives a simple key/value store. It can be shared and mutable, depending on creation parameters. Afaik it's mostly used for the implementation Mnesia, a native term database for erlang.

    4. Re:CSP makes parallel programming easy by TheRaven64 · · Score: 1

      As I understand it, [D]ETS works by spawning a process for handling the storage. When you interact with a [D]ETS store, you do so via a function wrapper around this process; the data store is not aliased, only the process handle is.

      --
      I am TheRaven on Soylent News
    5. Re:CSP makes parallel programming easy by iluvcapra · · Score: 1

      Yes, but sending Mnesia messages (inserting or updating rows) causes its response to functions (select statements) with identical parameters to have different return values, hence, Mnesia isn't pure functional and calls from one part of the system can cause calls in another part of the system to have different return values. Thus people say it isn't pure functional and has side-effects.

      That said, I don't have the slightest idea how you would write a database that is pure-functional, since the whole idea of a database is to share state, so I don't think the Mnesia people have anything to feel guilty about. Any CS types out there know what a database in a pure functional language looks like?

      --
      Don't blame me, I voted for Baltar.
    6. Re:CSP makes parallel programming easy by radtea · · Score: 2, Interesting

      the pure functional language Haskell

      <nitpick>

      Calling Haskell a "pure functional language" is a bit like calling C++ a "pure object-oriented language." There are parts of the Haskell language that allow you to do pure functional programming. But there are parts of the language that allow you to do things like I/O, too.

      </nitpick>

      --
      Blasphemy is a human right. Blasphemophobia kills.
    7. Re:CSP makes parallel programming easy by jbolden · · Score: 3, Interesting

      The analogy would be to call C a "low level language" even though C++ exists with high level extensions like the template system.

      What makes Haskell pure is that stateful code like I/O is handled through a monad so that it doesn't leak out into the rest of the code. The purpose of a computer program is to create a side effect. So every language needs to include some capacity to induce them. What separates pure from impure is whether side effects are scattered throughout the code or isolated.

    8. Re:CSP makes parallel programming easy by jonaskoelker · · Score: 2, Interesting

      The purpose of a computer program is to create a side effect.

      Back in the good old days, Haskell programs had type String -> String ;-)

    9. Re:CSP makes parallel programming easy by jbolden · · Score: 1

      Yep a far worse work around IMHO since it made things like working with a file a problem.

    10. Re:CSP makes parallel programming easy by QuestionsNotAnswers · · Score: 1

      I don't have the slightest idea how you would write a database that is pure-functional

      IANACS, but I think some version control systems could be pure functional databases. If the revision were a parameter to all calls, and checkins branch, then the result from the same operation (even if it were repeated) could be made to return exactly the same result (although trickier with writes).

      isolation levels are also relevant? Conventional databases that store all history also relevant?

      I agree it would be nice to see a CS type give a correct answer...

      --
      Happy moony
    11. Re:CSP makes parallel programming easy by Anonymous Coward · · Score: 0

      Well, the simpler answer is that a functional database system would pass and return entire databases as function parameters and results. The entire point of a "purely functional" system is that the expression of a function invocation denotes the value obtained from evaluating the function, and the same expression always denotes the same value.

      The concept of a transactional database is syntactically non-functional, in that it is modeled on query expressions and results, and the queries affect an implicit, stateful database store. But you could refactor that as functional expressions including query terms and the database value before the query, which results in the database value after the query and the query result.

      Somewhere between this functional abstraction and the real world, you have the messy problem of deciding how to share the database between different real-world isochronous processes which introduce query terms and consume query results, and that part is not purely functional. Somewhere deep in the transaction manager layer, the decision is made as to which database values are passed into which query evaluations, by stringing together a sequence of completing transactions. The rest is basically partial-evaluation and common-subexpression optimizations in a concurrent evaluator framework.

  4. Ooh so now it's a Pop language by goombah99 · · Score: 0, Offtopic

    Top of the pop chart on face book...

    here's the contest: I did the first phrase, you fill in another one and leave the next to someone else:

    SHANG A DO (loop) LANG
    (Jagger/Richards)

    Shang a doo lang, shang a lang erlang
    Shang a doo lang, shang a lang erlang
    Shang a doo lang, shang shang a erlang
    Shang a doo lang, shang a lang erlang

    Well you tell me, it's a lambda statement
    But I don't know what that meant
    that one plus one can't simply be two?

    He said he'd seen me, goin' out with Charlie
    I only did it, to make him really want me
    You say you'll get me, but I'll get him too

    Shang a doo lang, shang a lang erlang
    Shang a doo lang, shang a lang erlang
    Shang a doo lang, shang shang a erlang
    Shang a doo lang, shang a lang erlang

    But now I think the time is right
    So let him take me out tonight

    I really love him, yes I really love him
    I really want him, yes I really want him
    Yes I love him, tell him I love him too
    Yes I do, yes I do, yes I do, yes I do

    --
    Some drink at the fountain of knowledge. Others just gargle.
  5. On that note.. by bigattichouse · · Score: 1, Offtopic

    Anyone have an Erlang background, or some low level C or similar experience and live in the Chicago area (we're just south of the Loop)

    I'm actively involved in a startup that is developing a large project in Erlang, looking for some additional folks to add to our team.

    It's problematic trying to find people with the right skillset, since it isn't just "Erlang" we're looking for - its the general high-volume, high-availability skillset and a deep interest in learning Erlang. I didn't even know much about it before the project. So, fire away on the resumes:

    bigattichouse@gmail.com

    --
    meh
    1. Re:On that note.. by linzeal · · Score: 1

      How is this offtopic? Man, Slashdot moderation has gotten just mean lately.

    2. Re:On that note.. by Rycross · · Score: 1

      Its a job advertisement in a discussion forum. It is, technically, off-topic.

  6. If you want to know more... by jandrese · · Score: 3, Informative

    There is even a movie about Erlang that should give you a good idea of what its strengths are.

    --

    I read the internet for the articles.
    1. Re:If you want to know more... by synthesizerpatel · · Score: 1

      Around 4:35 I think.. Imagine this:

      hello?

      hello?

      whatt-tttttttsu-uuuuuuu-uuuup

      whaaaaaaa-aaaaa-aaaaaatuuuuuu uuu-uuuu-uuuuu-up

      WHUZZZZZZAA-AAAAAAA-AAAA-A ... watchin' the game, drinkin a bud

    2. Re:If you want to know more... by gknoy · · Score: 1

      I don't know if it's the color balance, or the seeming age of the film, but I keep expecting to hear the Monty Python theme song.

      (Disclaimer: I am really enjoying the Programming Erlang book, and actually do want to use it. :))

    3. Re:If you want to know more... by Anonymous Coward · · Score: 1, Informative

      This has been my absolute favorite in IT videos since I first saw it a year ago. It has that unashamed old-time dorkiness that I'm so nostalgic for. Get it in better-than-youtube quality at archive.org.

    4. Re:If you want to know more... by skeeto · · Score: 1

      The first time I saw that video I thought it was some kind of joke.

  7. Erlang use on FSM Virtual Radio Kernel by R80_JR · · Score: 1

    Erlang is also being used for the virtual radio kernel, which is used for software defined radios. Good article on the subject linked off the www.flex-radio.com FAQ's on PowerSDR V2.

  8. Interesting links by cdfh · · Score: 1

    See also an interesting paper on the history of Erlang, by Armstrong, and Erlang, The Movie.

  9. Wings 3D by UglyMike · · Score: 1

    Wings 3D (http://www.wings3d.com/), a popular subdivision modeler, was written in Ehrlang as well. That's were I first heard of the language some years ago...

  10. Why can't more people think like this... by DragonWriter · · Score: 4, Insightful

    I wish that this could become a universal precept of software design, shaping everything from OS's to desktop apps -- Joe Armstrong: "Stopping a system to upgrade the code is an admission of failure."

    1. Re:Why can't more people think like this... by Timothy+Brownawell · · Score: 1

      I wish that this could become a universal precept of software design, shaping everything from OS's to desktop apps -- Joe Armstrong: "Stopping a system to upgrade the code is an admission of failure."

      Trouble is, that's incredibly hard (expensive, limiting) to get right. So it only makes sense where you can't even schedule maintenance downtime or instruct the load balancer to send all requests to the other machine. So it's useful for the thing that your (and everyone else in town) single, non-redundant phone line plugs in to... and not terribly much else. Certainly not for a desktop where you're not even using it at night.

    2. Re:Why can't more people think like this... by iluvcapra · · Score: 1

      Well, a lot of people do think like this, except making it work in practice is very difficult, and implementing a system that allows code hot code upgrades usually requires so much indirection that efficiency suffers. Also, in practice, stoppiong a system to upgrade the code is a practical proposition, particularly for a home computer. Not everyone is running an ISP in their den.

      Even Erlang doesn't enforce hot code swapping, you the developer still have to write the code a particular way, so that, your function names bind to the currently running module, and not just the module they're defined in, so that your receive block is able to dispatch a new message to the new version of the module at the right moment. Deciding where in your process's flow to do this isn't trivial or abstracted away. It's not necessarily hard, either, but it requires cognizance.

      --
      Don't blame me, I voted for Baltar.
    3. Re:Why can't more people think like this... by dublindan · · Score: 1

      Maybe you don't use your desktop at night, but I imagine a lot of people here do... for whichever purposes... ;-)

  11. Erlangs by Maclir · · Score: 1

    "Erlang" is a measure of communications channel occupancy - names after the Danish mathematician and telephony researcher - but it also relates to how old telephones use to sound - when they had actual mechanical bells that would ring when a call was coming in - "erlang-a-lang-a-lang".

  12. flourished? by blueskies · · Score: 2, Insightful

    flourished ever since

    define flourished.

    1. Re:flourished? by conspirator57 · · Score: 1

      not end of lifed yet.

      but it's close to EoL judging by the small number of comments on this thread.

      --
      "If still these truths be held to be
      Self evident."
      -Edna St. Vincent Millay
    2. Re:flourished? by Anonymous Coward · · Score: 1, Funny

      People who use erlang know why they're using it and don't need to spam slashdot seeking validation (Python much?)

    3. Re:flourished? by DragonWriter · · Score: 1

      define flourished.

      Facebook chat, the rewrite of Delicious (formerly deli.cio.us), CouchDB, ejabberd, RabbitMQ, etc., etc., etc.

    4. Re:flourished? by blueskies · · Score: 1

      Only a million more projects to go....before it catches up to something like fortran.

    5. Re:flourished? by DragonWriter · · Score: 1

      Only a million more projects to go....before it catches up to something like fortran.

      Within the domain on which it is focussed (roughly, systems providing highly parallel communications infrastructure), Erlang is flourishing. Sure, that's not an area where there are as many individual projects as, say, scientific number crunching. And, sure, it hasn't been as long (or as early in the history of programming when there were so few competing options) as Fortran, either. So what?

    6. Re:flourished? by blueskies · · Score: 1

      So depending on how you define flourishing it still has some distance to go...

    7. Re:flourished? by DragonWriter · · Score: 1

      So depending on how you define flourishing it still has some distance to go...

      I would suggest that requiring that a language be used in as many projects as Fortran ever has been is a ludicrous standard for "flourishing".

    8. Re:flourished? by blueskies · · Score: 1

      python, perl, ruby, c, c++, java, php, bash, basic, c#, lua, pascal, cobol, lisp, brainfuck?

      I don't care what we pick, just that in comparison to other languages it doesn't appear to an outsider that it's flourishing. I'm just trying to understand the magnitude of it's flourishment.

  13. Programming Erlang by lewiscr · · Score: 3, Interesting

    I've been (slowly) working my way through Programming Erlang.

    I spend most of my day doing procedural and OOP. Odds are good that I'll never write a single Erlang program after I finish the book. But I guarantee that I'll be using the concepts that I'm learning for the rest of my life.

    For the same reason you had to take liberal arts classes in university, everybody should learn a functional language or two.

    1. Re:Programming Erlang by larry+bagina · · Score: 1

      I've used erlang to write a few utilities. Pattern matching makes it easier to prototype something, particularly binary pattern matching when dealing with network or file structures.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    2. Re:Programming Erlang by lewiscr · · Score: 1

      The example that searching an MPEG looking for header frames was pretty cool. It gave me bad flashbacks to when I had to search an unmountable filesystem and extract all the JPEGs[*]. The C code I wrote was horrible...

      *: I somehow managed to corrupt a VFAT partition enough that it wouldn't mount in Windows or Linux. Right after my wife unloaded the digital camera, but before she remembered to tell me to back up the photos. So I had to fix it. I scanned the entire drive, looking for the JPEG magic, and hoped the files were relatively unfragmented. It worked pretty well.