Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Programming Erlang

Posted by samzenpus on Wed Sep 05, 2007 01:43 PM
from the read-all-about-it dept.
gnalre writes "Every day it seems there is a new publication of a book on perl/python/ruby. Some languages however do not seem to get that sort of attention. One of those under-represented languages is Erlang, however for the first time in 10 years a new Erlang book has been published. As someone who had a brief flirtation with Erlang long ago, I was interested to see how the language had evolved in the intervening decade. I was also curious to re-evaluate Erlang to see what solutions it offered to the present day issues of writing reliable distributed applications." Read on for the rest of Tony's review.
Programming Erlang - Software For A Concurrent World
author Joe Armstrong
pages 515
publisher The Pragmatic Programmers
rating 8/10
reviewer Tony Pedley
ISBN 1-9343560-0-X
summary Parallel programming the easy way


Programming Erlang — Software For A Concurrent World (ISBN 10193435600X) is part of the pragmatic programmer series. As with all the books in this series, it is available in paperback or for a reduced cost you can directly download it in PDF format (which is always useful if you spend a lot of time on the move and you do not like carrying around a dead tree with you). The book's format and layout as with all the books of this series are clear and logical.

The book is written by Joe Armstrong, who co-authored the first Erlang book a decade ago. He was also one of the originators of the Erlang language and has been directly connected to its development ever since. We can therefore be assured about the author's knowledge and insight into the language, if not his impartiality.

The book itself can be roughly split into three main sections: Getting started and Sequential programming, Concurrent Programming and Erlang libraries and advanced Erlang techniques.

In Chapter 1 the author sets out his stall of why Erlang is worthy of your attention. It's clear from this chapter that the author feels Erlang's strength lies in applications requiring an element concurrency and fault tolerance. Another emphasis is made of running Erlang on modern multi-core processors, something that was only a glint in a hardware designer's eye 10 years ago, but is rapidly becoming an issue in all areas of programming. From this chapter you also get a feel on how the author approaches his programming in that he states that he wants the reader to have fun with the language, which is a refreshing change to some language text books whose main purpose appears to be as a cure for insomnia.

Chapter 2 goes through installing Erlang and the Erlang shell (a command line environment similar to ones with languages such as perl). The chapter also starts us into the strange world of functional programming, where variables can only be given a value once (e.g you cannot do i=i+1), recursion replace loops and pattern matching replaces assignments. Fortunately the Erlang language is remarkably concise. For example there are only 4 data types. However to those coming from a purely procedural programming background the learning curve could be a steep one. Saying that the Author does a good job of leading you through the languages intricacies with examples being compared to code from languages such as Java to help keep your feet on solid programming ground.

The next 3 chapters move on to writing simple Erlang programs. As a quick aside, for anyone new to Erlang it is well worth examining the quicksort implementation described in chapter 3. Its conciseness and simplicity was one of the reasons the language won me over when I first met the language.

These chapters also cover error detection and handling. It's worth noting that Erlang has a philosophy of ensuring programs fail hard, so that bugs can be weeded out at an early stage. This idea very much defines how Erlang error handling is defined.

One criticism of the first section is Chapter 6, which describes compiling and running an Erlang program. I would have preferred that this information be covered earlier in the book or be placed in an appendix because it is probably an area you will want to reference repeatedly.

Chapter 7 is where things really get interesting and the true power of Erlang starts to come to the fore. This is where Erlang's concurrency credentials are explained. This chapter begins by providing some useful metaphors of the Erlang concurrent model, but chapter 8 is where the fun begins by describing the Erlang concurrency primitives that allow the creation of processes and the process communication methods. The author here highlights one of the language features, the Erlang light weight process. These are true processes (not threads) but take up very little in the way of resources. Indeed it is not unusual to have 1000's of such processes running in an application.

The next few chapters expand on the available concurrency primitives and how to move from concurrency on your local processor to concurrency utilizing the resources of multiple machines either on a local network or across the web. It finishes the section off by showing the example of a simple IRC application.

Chapter 12 starts the next section by looking at how to interact with the world outside the Erlang environment. First it examines how to interface an Erlang program to applications written in other languages such as C. It then goes onto to look at file and socket handling in Erlang. Chapter 15 looks at two important Erlang storage primitives ETS and DETS before we get to the OTP Erlang libraries in Chapter 16.

The OTP libraries are the standard Erlang libraries and tools. In fact the OTP libraries are worthy of a book in itself. The author highlights the section on the generic Server module as the most important section in the whole book and one to be reread until its importance has sunk in. This is because here are encapsulated many of the lessons learned in writing industrial fault-tolerant applications, such the updating of a running applications code without causing that application to miss a beat. The section is finished off by describing the Erlang distributed database (humorously named Mnesia) and then finishing it off with the example of a simple server application.

The book finishes off by looking at Erlang on multicore systems including its support for SMP. As the author states this is the leading edge of present day Erlang and is still under development.

I would like to thank the pragmatic programmers for publishing this book. Erlang's profile has been in need of highlighting for many years and hopefully this book will help. The book definitely provides a great starting point for anyone who wants to get to grips with the language and takes them to the point where they can start writing useful applications. This book is a worthy successor to the last book published and does a good job of both updating the material and explaining some of the later developments such as SMP. Anyone who has a need for writing fault tolerant applications should at least look at this book. If nothing else you will never be afraid of dealing with recursion ever again.

In many ways the book cuts off just when things are getting interesting. There are hints in the book about real world Erlang's applications and it would have been good if some of these experiences could have been expanded. Hopefully this book is the start of increased exposure for Erlang. If so then someone may get around to writing another Erlang book describing some of the advanced issues about generating robust applications. I just hope it won't take another 10 years this time.

Tony Pedley is a senior engineer specializing in real-time embedded systems. In his spare time he likes to tease windows programmers and confuse managers by telling them it would be a lot easier if we wrote it in Erlang.


You can purchase Programming Erlang - Software For A Concurrent World from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • Try it out (Score:5, Informative)

    by romiz (757548) on Wednesday September 05, @01:51PM (#20483307)
    The first chapter [pragmaticprogrammer.com] is avalable online to get a taste of the book (and the language).
  • Great book creation process (Score:4, Informative)

    by DoofusOfDeath (636671) on Wednesday September 05, @01:56PM (#20483403)
    I bought the book while it was still being written. I was able to download drafts, and (if I had the time) submit bug reports. When it was finally done, I got a printed copy in the mail.

    I haven't had much time to play with Erlang (or the book) yet, but it was a really nice feeling to be able to get early access as long as I was willing to see unpolished content. Bravo, publisher.
  • What's missing from Erlang... (Score:5, Interesting)

    by SanityInAnarchy (655584) <ninja@slaphack.com> on Wednesday September 05, @01:58PM (#20483437)
    (Last Journal: Tuesday October 30, @10:59AM)
    Last I checked, there was an implementation issue and a design issue.

    The design issue, for me, was a lack of namespaces. I think it might have been that I can't have an atom with a namespace, beyond prefixing, which is a hack for languages that don't support namespaces.

    The implementation issue was that you had to choose between performance and being able to reload functions later. I would very much like it to be able to JIT or even compile down to binary (x86_64 too, pretty please?), then be able to just leave it running, and have it reload functions as needed.

    I'll have to think of what else I didn't like, but I don't think there was much, aside from some odd syntax. I don't actually have a problem with the somewhat functional nature of it, just certain syntax that looks ugly, but that's a matter of opinion, and something I can live with.
  • Name mixup? (Score:1)

    by Hoppelainen (969375) on Wednesday September 05, @01:58PM (#20483439)
    Perhaps it should have been given another name than a common statistical probability distribution (for some reason people who explore new programming languages are often interested in math and may therefore mix things up)

    http://en.wikipedia.org/wiki/Erlang_distribution [wikipedia.org]

  • At the bookstore (Score:1, Flamebait)

    by CaffeineAddict2001 (518485) on Wednesday September 05, @01:58PM (#20483441)
    It shares half a shelf with the Standard ML and Haskell books. The other half taken up by the shrink wrapped "The Art of Computer Programming" that has been sitting on there since the store opened.
    • Funny not Flame by toddhisattva (Score:1) Wednesday September 05, @09:11PM
    • 1 reply beneath your current threshold.
  • by ikewillis (586793) on Wednesday September 05, @02:02PM (#20483511)
    (http://clickcaster.com/)
    This book is written by the language's creator, Joe Armstrong, and provides one of the best introductions to a programming language I've ever seen. The entire approach is nicely bottom up, with the idiosyncrasies of the syntax presented immediately so they are not confusing later. More powerful features are introduced, such as the tools for concurrent and distributed programming, with the book finishing off with the immensely powerful Open Telcom Platform and its associated tools, such as the "one server to rule them all" gen_server implementation and Erlang's distributed database, Mnesia.

    All in all this is an excellent book about an excellent language and I would highly recommend it to any programmer, especially those concerned with the multicore future which will increasingly demand concurrent programming languages.
  • Wings3D (Score:4, Informative)

    by UglyMike (639031) on Wednesday September 05, @02:04PM (#20483535)
    Strange that I didn't see Wings3D mentioned yet. ( http://www.wings3d.com/ [wings3d.com] )
    It's an open-source subdivision surface modeler held to great esteem in the modeling scene

    It is also an Erlang application....
    • Re:Wings3D by TheRaven64 (Score:3) Wednesday September 05, @04:38PM
    • 1 reply beneath your current threshold.
  • Review worth a +1 karma! (Score:5, Informative)

    by Z00L00K (682162) on Wednesday September 05, @02:06PM (#20483573)
    The review is well written, and even though Erlang is a programming language that not everyone is used to program in it's well worth to mention that a large number of telecommunication devices from Ericsson are running software written in Erlang, so most people has probably been using it without knowing it.

    And in my opinion; If you are familiar with more common languages like C and Java you should take a deeper look into Erlang unless you prefer to study Prolog or Cobol. Just take a dip or a deep plunge, you never know when you end up in a project where knowing Erlang may prove useful - it is actually developed to be used in real applications and not as a theoretical study object.

    And Erlang is designed to handle concurrent programming from the bottom, which is a real problem in large multi-user systems. You can of course use C or Java and solve concurrency problems with semaphores or synchronization, but the solution in Erlang may be much more elegant.

    And for all of you that are familiar with the Eclipse development environment; There is a plugin called Erlide [sourceforge.net].

  • by lib3rtarian (1050840) on Wednesday September 05, @02:14PM (#20483695)
    I just looked up Functional Programming in Wikipedia. Wow, I thought assembly was bad. Albeit, I didn't spend more than fifteen minutes on it, but, after reading this review, and looking at some examples, I'm totally confused.
    I pulled this example from Wikipedia:

    # imperative style
    target = [] # create empty list
    for item in source_list: # iterate over each thing in source
    trans1 = G(item) # transform the item with the G() function
    trans2 = F(trans1) # second transform with the F() function
    target.append(trans2) # add transformed item to target

    A functional version has a different feel to it:

    # functional style
    # FP-oriented languages often have standard compose()
    compose2 = lambda F, G: lambda x: (F(G(x))
    target = map(compose2(F,G), source_list)

    The first block of code is easy to understand. The second block, whoah, I guess I just have to take your word that it does the same thing as the first block. Can someone give me an introduction/explanation to Erlang / functional programming that I can understand? At this point, I don't even understand what situations this could be usefully applied to.
    It seems interesting though...
    • Re:I know why it's been 10 years by stormcoder (Score:1) Wednesday September 05, @02:26PM
    • Re:I know why it's been 10 years by BitGeek (Score:2) Wednesday September 05, @02:42PM
    • Re:I know why it's been 10 years (Score:5, Insightful)

      by J.R. Random (801334) on Wednesday September 05, @02:50PM (#20484441)

      There is nothing in the second example that isn't completely familiar to anyone who has ever programmed in LISP, one the world's oldest programming languages.

      Newbies, feh!

      [ Parent ]
    • Re:I know why it's been 10 years by curri (Score:1) Wednesday September 05, @02:51PM
    • Re:I know why it's been 10 years by poopdeville (Score:1) Wednesday September 05, @03:07PM
    • Re:I know why it's been 10 years by k8to (Score:1) Wednesday September 05, @03:19PM
    • Re:I know why it's been 10 years by be-fan (Score:3) Wednesday September 05, @03:23PM
    • Re:I know why it's been 10 years by Just Some Guy (Score:3) Wednesday September 05, @03:24PM
    • Have you ever written a loop? (Score:4, Informative)

      by Estanislao Martínez (203477) on Wednesday September 05, @03:30PM (#20485325)
      (http://www.adequacy.org/)

      It's very different, but the big advantage is that it's higher level than the stuff you confess to understanding better.

      The code in question (in Python? not a great choice for doing an example!) uses two very common higher-order operations in functional programming: map and compose. A map operation takes a complex data structure (most common example: a list), and a function that applies to elements of that data structure, and returns another structure, with the same "shape," where each element in the result is related to its corresponding element in the original structure by being the result of apply the function. Thus, if you have a list [2, 3, 5, 7], and a function inc that increments a number by one, map(inc, [2, 3, 5, 7]) evaluates to [3, 4, 6, 8].

      In the case of a list, map is can be implemented by creating a new list of the same length as the original, looping over the list, applying the function to each value, and storing the result in the result list. This is a kind of task that imperative programmers find themselves doing all the time. The problem with this, however, is that if you're writing code like this all the time, you're writing at a much too low level, with the all the disadvantages of that:

      1. It takes you longer to write code. Instead of writing just result = map(fn, myList), you have to write a loop.
      2. Your code is specifying the mechanism to convert the input list into the output list over and over, instead of describing the relation between the lists. Suppose you want to change the mechanism for doing this sort of operation, e.g., to parallelize it. In functional style, you can just rewrite map to do its work in parallel. In imperative programming, you have to work harder.
      3. The concept of mapping a function over a structure, to produce a new structure with values related to the original by the function, applies to many kinds of data structure, not just sequences. You can write equivalents of maps for any container data function you like, even though the mechanics are different; e.g., to implement a map function over a tree you typically use recursion. This means that in the imperative style, the code for "increment all the values of this list by 1" looks very different from the code for "increment all values in this tree by 1"; in functional programming, they will at least look very similar, if not completely the same.
      4. There are many, many other common progamming blocks that you can abstract into a function in functional programming, but not in imperative programming. For example, filtering a list to only keep the elements that satisfy a boolean function, which in functional programming is usually just a function called something like filter. For example, if you have a function called even, that returns true only for even numbers, here's how you get the even numbers in myList: filter(even, myList)
      5. Functional programming solutions often compose more easily than imperative ones; i.e., it is easier to put them together to solve more complex tasks. For example, if you need to increment a list of numbers by one each, and only keep the ones that are even in the result, you can do that easily and transparently: filter(even, map(inc, myList)). In the imperative style, the patterns for mapping and for filtering don't combine this straightforwardly.
      6. Functional code is usually easier to read. When I read a piece of imperative code and come across a loop, I normally have to work the steps a bit in my mind in order to see what it is that it does: "Hmm, we create a new list at the beginning, then we loop through the elements of this other list, and as we go through each one, we apply a function to it, and put the result in the list we first created. Ah, we're mapping over the list." In functional programming, these common patterns find immediate expression in a higher-order function, and this higher order function, essentially, describes the relationship between the input and the output directly: "Ah, he's using map, so the result will be a list, with the same number of elements as the original, and each element in the result will be related to exactly one in the original, and in this way."

      Thus, in short, functional programming is useful nearly every time that you write a loop or a recursive algorithm today, because it replaces the explicit looping or recursive mechanics that you use today, with an application of a higher order function that describes how the input relates to the output; and in addition, it allows you to write your own such custom functions, and rewrite them at will to change how they do what they do.

      [ Parent ]
    • Re:I know why it's been 10 years by Edward Kmett (Score:3) Wednesday September 05, @03:39PM
    • Re:I know why it's been 10 years by MenTaLguY (Score:2) Wednesday September 05, @03:46PM
    • Re:I know why it's been 10 years by DavidHumus (Score:1) Wednesday September 05, @04:46PM
    • Re:I know why it's been 10 years by Taagehornet (Score:2) Wednesday September 05, @05:19PM
    • Imperative, OO, Functional, and Logic by tknd (Score:2) Wednesday September 05, @05:48PM
    • Re:I know why it's been 10 years by DragonWriter (Score:2) Wednesday September 05, @06:55PM
    • Re:I know why it's been 10 years by Clueless Moron (Score:2) Wednesday September 05, @08:48PM
    • Re:I know why it's been 10 years by AuMatar (Score:1) Wednesday September 05, @02:38PM
      • Re:I know why it's been 10 years by MenTaLguY (Score:2) Wednesday September 05, @03:21PM
      • Re:I know why it's been 10 years by ForumTroll (Score:3) Wednesday September 05, @03:26PM
      • Re:I know why it's been 10 years (Score:5, Insightful)

        by be-fan (61476) on Wednesday September 05, @03:34PM (#20485407)
        Also next to impossible to maintain, debug, or understand.

        Uh, if you don't know functional programming, then yeah. If you do, it's instant to understand, and can be maintained more easily because there is less of it to maintain.

        Your argument basically amounts to "stuff I don't know is hard to understand". No shit. New notation and concepts have to be learned, yes, but there is a point to learning them. It makes things simpler and easier once you have learned them. Consider, why do people in signal processing do all sorts of Z transforms and Fourier transforms and whatnot on data? Surely it's _easier_ to just think of a sound signal as a series of amplitudes at discrete time intervals? The thing is --- it isn't. Once you learn all that math, you can do stuff with signals by hand that you couldn't even have dreamed off if you'd used a less powerful technique.
        [ Parent ]
      • Re:I know why it's been 10 years by TheRaven64 (Score:2) Wednesday September 05, @04:45PM
      • Re:I know why it's been 10 years by Algan (Score:3) Wednesday September 05, @05:09PM
      • Re:I know why it's been 10 years by Estanislao Martínez (Score:1) Wednesday September 05, @09:16PM
    • 5 replies beneath your current threshold.
  • Huh? (Score:2)

    by homer_s (799572) on Wednesday September 05, @02:20PM (#20483795)
    Saying that the Author does a good job of leading you through the languages intricacies with examples being compared to code from languages such as Java to help keep your feet on solid programming ground.

    • Re:Huh? by moderatorrater (Score:2) Wednesday September 05, @05:42PM
      • Re:Huh? by homer_s (Score:2) Thursday September 06, @09:53AM
        • Re:Huh? by mikehoskins (Score:2) Thursday September 06, @10:15AM
  • I had my first encounter with Erlang at a Ericsson presentation back in 1994. It's amazing that more than ten years have passed since then, and only now is the language becoming more mainstream! This new-found attention is well-deserved, however: Erlang will feel right at home in those +80 CPU cores on the horizon...

    As for other less conventional languages, OCaml also definitely deserves a look. It is functional, though also allows imperative features; it has a powerful module system, but also supports object-oriented programming; it has a certain academic feel, but real-world performance (check the shootout if you want: it's among the fastest ones, comparable to C++) and a very good and comprehensive repository of libraries (even for low-level stuff!). Definitely one of the best things to come out of France in recent memory!

    • 1 reply beneath your current threshold.
  • Erlang... (Score:1)

    by tomq123 (194265) on Wednesday September 05, @02:28PM (#20483919)
    the new programming language du jour.
  • Overall, the book is very good: the examples are clear and useful, and for an old Prolog programmer like me, Erlang has a natural feel to it.

    I have been disappointed that none of my customers seem to be interested in Erlang development - I proposed using it for one application where 'share nothing' asynchronous communication seemed like a very good fit.
  • Be careful (Score:1, Troll)

    by roman_mir (125474) on Wednesday September 05, @02:33PM (#20484015)
    (http://booktextmark.mozdev.org/)
    If you program in Erlang you will look like these guys. [youtube.com] (Oh, and I think these people actually believe that it is a good idea to allow modification of code directly in production environment. I think a library can be written explaining why this is a dumb idea.)
    • Re:Be careful by BitGeek (Score:2) Wednesday September 05, @02:40PM
      • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @02:46PM
        • Re:Be careful by k8to (Score:2) Wednesday September 05, @02:56PM
          • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @02:59PM
            • Re:Be careful by Chandon Seldon (Score:2) Wednesday September 05, @04:36PM
        • Re:Be careful by be-fan (Score:3) Wednesday September 05, @03:52PM
          • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @04:26PM
            • Re:Be careful by be-fan (Score:2) Wednesday September 05, @06:13PM
              • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @06:33PM
              • Re:Be careful by be-fan (Score:2) Wednesday September 05, @06:41PM
              • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @08:58PM
              • Re:Be careful by be-fan (Score:2) Wednesday September 05, @11:23PM
              • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @11:32PM
              • Re:Be careful by roman_mir (Score:2) Thursday September 06, @09:14AM
                • Re:Be careful by roman_mir (Score:2) Thursday September 06, @10:36AM
                • 1 reply beneath your current threshold.
              • 1 reply beneath your current threshold.
        • Re:Be careful by ubikkibu (Score:1) Wednesday September 05, @05:52PM
          • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @08:54PM
            • 1 reply beneath your current threshold.
    • Re:Be careful by Chirs (Score:2) Wednesday September 05, @02:46PM
      • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @02:49PM
        • Re:Be careful by Anonymous Coward (Score:1) Wednesday September 05, @03:14PM
          • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @03:30PM
        • Re:Be careful by MenTaLguY (Score:2) Wednesday September 05, @06:25PM
          • Re:Be careful by roman_mir (Score:2) Wednesday September 05, @08:51PM
            • Re:Be careful by MenTaLguY (Score:2) Thursday September 06, @12:33PM
    • No, not a "good idea," by ubikkibu (Score:1) Wednesday September 05, @03:31PM
    • Re:Be careful by pintpusher (Score:2) Wednesday September 05, @03:37PM
  • OOP to Erlang (Score:2)

    by chiph (523845) on Wednesday September 05, @02:37PM (#20484109)

    The author here highlights one of the language features, the Erlang light weight process. These are true processes (not threads) but take up very little in the way of resources. Indeed it is not unusual to have 1000's of such processes running in an application.

    Would a good analogy be that an Erlang process is comparable to an object instance, in that both are loosely coupled (ideally), focused on one task (ideally), but in Erlang they're all running asynchronously and the OS/runtime automatically handles the communications for you?

    Chip H.
  • by vik (17857) on Wednesday September 05, @02:52PM (#20484475)
    (http://olliver.family.gen.nz | Last Journal: Tuesday October 17 2006, @10:04PM)
    A great book on Erlang, but missing a few details on the usage of common libraries. In particular it could do with more information on how to drive the Mnesia database. I started programming Erlang a month ago and the shortage of implementation docs on the database and list libraries has been a problem for me.

    Yes, I do know about the Ericsson Mnesia manual and http://trapexit.org/ [trapexit.org]

    Vik :v)
  • by the_olo (160789) on Wednesday September 05, @02:57PM (#20484595)
    (http://olo.org.pl/)

    It's worth noting that ejabberd [jabber.ru] is written in Erlang.

    For those who haven't heard about it, it's an open source, distributed, fault-tolerant instant messaging server (Jabber/XMPP), modular and very configurable and is readily available in most Linux distributions' repositories.

    It's one of the most promiment erlang-based projects.

    • 1 reply beneath your current threshold.
  • by Hoplite3 (671379) on Wednesday September 05, @02:59PM (#20484619)
    It's worth looking at

    http://shootout.alioth.debian.org/gp4/benchmark.ph p?test=all&lang=hipe&lang2=hipe [debian.org]

    for the general performance of erlang. It compares unfavorably in those tests to lisp and clean, two other functional programming languages.
  • by pnis (664824) on Wednesday September 05, @03:07PM (#20484815)
    As somebody writing code in Erlang as a profession, I say, though it has strength, it's crap. It has strength in the efficient handling of many processes (faster then the OS when there are many many thousands of them), aand (re)loading modules on the fly into the virtualmachine is nice. But on the flipside Erlang is slow as it's a very high level language, with a not so clever virtual machine - much less so than java vms (well I have to admit I am an assembly&C fan). Also functional programming my ass. In reality it's more like very basic barebone declarative programming, where you can only use global variables (mnesia database, and in worse cases the process dictionary) and there are no loop constructs (you can only use ugly additional functions and recursion instead of a "for" construct). Well, at least this is my opinion.
  • by dominux (731134) on Wednesday September 05, @03:11PM (#20484923)
    (http://dis29500.org/)
    to give you an example of something built in Erlang take a look at http://www.couchdb.com/ [couchdb.com] CouchDB is an Open Source (GPL) database back end. It is in some ways inspired by the database architecture of Lotus Notes, it is a non-relational document based store with strong replication ability. Don't bother bitching about Notes, the new UI is quite different to the old look (personally I liked the old style) but CouchDB doesn't have a UI, it has similarities at the architecture level which is where Notes is very very good indeed, and CouchDB is better.
  • classic papers (Score:2, Informative)

    by rsilverman (266807) on Wednesday September 05, @03:59PM (#20485889)
    Here is a classic paper on the style and advantages of functional programming:

    http://www.math.chalmers.se/~rjmh/Papers/whyfp.htm l [chalmers.se]

    Also, John Backus' Turing Aware lecture, "Can Programming Be Liberated from the Von Neumann Style?"

    http://www.stanford.edu/class/cs242/readings/backu s.pdf [stanford.edu]

  • An article on functional programming is the perfect time to introduce my new son, Nick, to Slashdot. Previous releases were in C [slashdot.org], Perl, and Python [python.org]. Since Nick's functional, this one [honeypot.net] is in Lisp.

    Mod me up or my son will spit up on you.

  • by WamBamBoozle (113151) on Wednesday September 05, @06:55PM (#20488053)
    (http://tomzilla.org/)
    Erlang uses POSIX threads to manage more erlang threads. They are not processes. Of course, POSIX threads are implemented on top of system threads which are implemented on top of the scheduler which may or may not be scheduling multiple cores. The wonderful thing about Erlang and logic programming languages in general is that they can be understood as applications of rules. They are Applicative. If you have a predicate

    a:- b, c.
    a:- d, e.
    There are two kinds of parallelism available here: or parallelism and and parallelism. A clever scheduler can arrange for the subgoals b, c, d, and e to run in parallel. An or parallel implementation would attempt to prove (b,c) concurrently with (d,e) and an and parallel implementation would attempt to prove b concurrently with c and then, if either or both of those failed, would attempt to prove d concurrently with e. The fun begins when variables are shared across the subgoals. Scheduling can get very interesting then. Erlang gave up on that and instead insists that you schedule it yourself and then gave you good primitives to do so.
  • IAAEP (Score:4, Insightful)

    I am (well, was, at least) an Erlang Programmer. I was toying around with Erlang for some small projects [sf.net] with distributed programming.

    I've been looking forward to Joe's book for a long time, as he's one of the few big names in the Erlang community, and has done a lot of work (both code and, even more importantly, documentation) for the community -- first that jumps to mind is his important look at Yaws vs. apache [www.sics.se].

    There are serious problems with the Erlang language as a whole and the community, right now. The mailing lists are actually pretty good, but quite frankly, the documentation online is terrible and the Erlang interpreter is pretty rudimentary. Not to mention basic problems with the syntax and grammar of the Erlang language itself. When I was learning Erlang a few months back, I was pretty frustrated that about the only source of documentation was on erlang.org [erlang.org], and they.. weren't great. For instance, there needs to be a big warning right at the beginning explaining that atomic values always start with a lowercase letter and all other variables must begin with a capital letter. This must be a huge problem for other beginners (at least, I hope I assume I wasn't alone..) compounded by the unfriendliness of the error messages produced by the Erlang interpreter.

    Now that I've switched over to doing as much as I can in Python, which has a great user community, wonderful docs, a healthy standard library, and a reasonably helpful interpreter.. I don't really worry about Erlang that much anymore. It would be wonderful if I could write, say, web crawlers (I work in web security) in Erlang. But the mysql support in Erlang looks alpha-quality at best, and AFAIK there's nothing even remotely similar to Python's urllib2 for basic web client functionality in Erlang.

    I think it says a lot that so much attention is paid to a language that is so rough around the edges, unfriendly, and lacking in documentation. Even given all that.. the ease of use of the concurrency and message passing in Erlang is so fantastic that it almost makes up for the rough spots.

    On a final note, I'd like to point out to anyone interested that I think there's a huge void out there for a language that's as easy to use and learn as Python, but with the concurrency and message passing in Erlang. It actually might not take that much work to build a network-transparent message passing interface as a Python module (I've looked into Pyro [sourceforge.net] a bit.. it looks rather cumbersome and makes easy things too hard, correct me if I'm wrong). Also, modern languages need basic support for splitting up the workloads of map() or similar trivially parallelizable functions across multiple processors/cores (I know the Perl6 group was thinking about this.. not sure if this works in Parrot now or what). Basically, modern languages like Python/Perl/Ruby should really think more about making simple modules to mimic the message passing that Erlang has. Really, a little bit of code could go a long way. The Google team put together sawzall [google.com] which looks kind of cool, on this note..

    • Re:IAAEP by yanagasawa (Score:1) Thursday September 06, @08:01AM
    • Re:IAAEP by DaveTerrell (Score:2) Thursday September 06, @07:07PM
  • by scottsk (781208) on Thursday September 06, @06:26AM (#20492569)
    (http://www.scottmcmahan.net/)
    Why do Haskell, Erlang, Prolog, etc abandon the clean, easy-to-understand syntax of LISP? I was reading "Beautiful Code" and saw some Haskell and it looked like a mess just visually to the naked eye. A while back I tried to install a package written in Erlang and thought it was kind of ugly too. I wonder why the FP side of the universe hasn't stuck with the simple, clear syntax of LISP. The structured/OO side of the universe has standardized on C syntax (C, C++, C#, Java, Perl, etc etc etc) which may be quirky (like LISP is) but is standard and anyone who knows one can follow along code in the other. I know Common LISP and Scheme, but was so baffled by Haskell I wondered if the syntax was serious or a FP equivalent of INTERCAL. Some of these FP languages are incredibly marginal because they're inscrutable even if you've had some background in functional programming with LISP.
  • Erlang, the Movie (Score:1)

    by xteddy (245318) on Thursday September 06, @09:32AM (#20494279)
    It's about time, that someone posts a link to "Erlang, the Movie"! So here it comes:

    http://www.youtube.com/watch?v=uKfKtXYLG78 [youtube.com]
  • by Skinkie (815924) on Wednesday September 05, @02:05PM (#20483555)
    (http://www.stefan.nl/)
    One of the first alternatives as for the 'normal' jabber server implementation was written in erlang. Resulting in ejabberd [jabber.ru] people care :)
    [ Parent ]
  • Re:The Seven Deadly Sins of Erlang (Score:4, Insightful)

    by Anonymous Coward on Wednesday September 05, @02:10PM (#20483641)
    Lets look at these "sins":
    1. Not a sin, not needed and shows you don't know what you're talking about wrt reliability. hard real time is irrelevant.
    2. More FUD based on your lack of understanding of programming.
    3. is a downright lie
    4. Contradicts three!
    5. Ok, now I'm thinking you're not just a troll but verifiably insane. Show us a language (one that exists outside your head) thats not "alkorithmic"
    6. Contradicts itself- is it based on english or is it cryptic?
    7. Asinine in the extreme, and of course contradicted by the other 6 points. erlang is not logo

    Bottom line- you are just making assertions that make no sense. If you ever were a programmer, you never learned much about programming... and your constant bashing of erlang is just an attempt to get attention. COSA doesn't exist, except in your head, where it can be magical and change as is needed for you to make whatever "point" you want to make.

    I guess its a sign that erlang is becomming mainstream that it has attracted a loon such as yourself.
    [ Parent ]
  • Re:The Seven Deadly Sins of Erlang (Score:5, Insightful)

    by Wesley Felter (138342) <wesley@felter.org> on Wednesday September 05, @02:15PM (#20483707)
    (http://felter.org/wesley/)
    Summary: "Erlang isn't based on my fringe pet theory, so it sucks".
    [ Parent ]
  • I often judge the quality of something by looking at the quality of the criticisms of it. If that's the best criticism of Erlang that you can find (or come up with) then Erlang looks pretty damn good. Of course, if you could see your way clear to describing how to write programs without implementing algorithms instead of simply explaining in great detail that algorithmic software is bad, maybe I would find it easier to embrace your view of programming.
    [ Parent ]
  • Re:The Seven Deadly Sins of Erlang (Score:3, Informative)

    by ibullard (312377) on Wednesday September 05, @02:21PM (#20483821)
    That is the same guy who says you can get artificial intelligence from the bible [rebelscience.org]. He's a loon with a large vocabulary.
    [ Parent ]
    • Postblablurb by zeromorph (Score:2) Wednesday September 05, @02:48PM
      • Re:Postblablurb by Fujisawa Sensei (Score:2) Wednesday September 05, @04:53PM
  • by webfiend (112579) on Wednesday September 05, @02:22PM (#20483843)
    (http://coolnamehere.com/)
    It's just another angry rant, quick to denounce anybody that disagrees. I can get those from deranged street people or by staying on slashdot.
    [ Parent ]
  • by MoeDrippins (769977) on Wednesday September 05, @02:30PM (#20483955)
    A counter-counter-opinion: http://www.planeterlang.org/story.php?title=Erlang _vs-_Trolls [planeterlang.org]

    And don't forget: http://www.google.com/search?q=louis+savain+crackp ot [google.com]
    [ Parent ]
  • by imsabbel (611519) on Wednesday September 05, @02:30PM (#20483967)
    Well, thats it.

    The blog you link (especially the authors reactions to criticism in the comments) show that he should really have been aborted when it was still possible.
    [ Parent ]
  • [insert picture of a cracked pot here]

    ahahaha... Funny. This is one crackpot that you're gonna be hearing a lot about from now on. By the way, Erlang has many more sins than the ones listed, though. Did you know that Erlang cannot do fine-grain parallelism? That's right. There is no parallel quicksort algorithm in Erlang. Ooops. It cannot do it. What good is an algorithmic language in a computing world that's moving full speed toward massive parallelism? I just thought I'd mention these things, just to piss off my detractors. ahahaha....
    [ Parent ]
  • by ubikkibu (544498) on Wednesday September 05, @03:23PM (#20485203)
    Seriously, is it? Because those criticisms are pathetic, and two contradict each other.

    I'd actually like to read a serious criticism of Erlang. I finished "Programming Erlang" on Sunday, and like many folks, I'm mildly jazzed about Erlang. The syntax hurts somewhat, but then again I spend all day coding Python. And while I can think functionally somewhat, I have a hard time imagining larger systems without OOP, but that's probably my lack of experience.

    I'm ready to do something good with Erlang, but I'd like more contrary opinions before I do so.

    (The book was outstanding--a pleasure to read.)
    [ Parent ]
  • by ralphbecket (225429) on Thursday September 06, @07:05PM (#20501499)
    That's the funniest thing I've read in ages.

    The author was joking, right?
    [ Parent ]
  • 9 replies beneath your current threshold.