ŷ

Jump to ratings and reviews
Rate this book

Programming Erlang: Software for a Concurrent World

Rate this book
Erlang solves one of the most pressing problems facing developers today: how to write reliable, concurrent, high-performance systems. It's used worldwide by companies who need to produce reliable, efficient, and scalable applications. Invest in learning Erlang now. Moore's Law is the observation that the amount you can do on a single chip doubles every two years. But Moore's Law is taking a detour. Rather than producing faster and faster processors, companies such as Intel and AMD are producing multi-core devices: single chips containing two, four, or more processors. If your programs aren't concurrent, they'll only run on a single processor at a time. Your users will think that your code is slow. Erlang is a programming language designed for building highly parallel, distributed, fault-tolerant systems. It has been used commercially for many years to build massive fault-tolerated systems that run for years with minimal failures. Erlang programs run seamlessly on multi-core computers: this means your Erlang program should run a lot faster on a 4 core processor than on a single core processor, all without you having to change a line of code. Erlang combines ideas from the world of functional programming with techniques for building fault-tolerant systems to make a powerful language for building the massively parallel, networked applications of the future. This book presents Erlang and functional programming in the familiar Pragmatic style. And it's written by Joe Armstrong, one of the creators of Erlang. It includes example code you'll be able to build upon. In addition, the book contains the full source code for two interesting applications:

519 pages, Paperback

First published July 11, 2007

108 people are currently reading
817 people want to read

About the author

Joe Armstrong

31books19followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
259 (34%)
4 stars
301 (40%)
3 stars
144 (19%)
2 stars
36 (4%)
1 star
9 (1%)
Displaying 1 - 30 of 38 reviews
Profile Image for Ettore Pasquini.
135 reviews119 followers
May 31, 2019
Perhaps the most challenging part of software engineering is striving to build something that is simple. Simplicity to me means something that you can fully grasp intuitively, ignoring the irrelevant. And then use it to enrich your language and build on top of it.

This is also the premise of OOP but for many reasons it’s easy to get bogged down with classes/methods that end up doing too much. My (novice) understanding of Erlang is that Erlang guides you more forcefully to a path that avoids certain traps. You have pure functions with no side effects. You declare and match, not assign and update. You use recursions, not loops, which again is tied to the former point and also makes you think at “what�, more than “how�. You feel at home dealing with concurrency, which let’s face it, it’s the origin of a ton of issues and the related “hacks� to deal with it. Erlang has a thing for terseness, too, not just syntactically but more importantly architecturally: large functions or modules end up being somewhat unusual. (Or so it seems to me!) All of this informs the programmer almost immediately if they’re doing it the Erlang-way or not.

In other words I feel like OOP is easier to work with but Erlang/FP is simpler. Maybe if I didn’t learn OOP first I’d think differently?

Joe Armstrong recently passed and it’s sad to see such a master go. His book is sort of the equivalent of the K&R’s C Language. I love how he explains everything tersely (ok sometimes a bit too much) and with precision, respectful of your intelligence. His style is leading by example and he encourages you to try things out as you read. He also adds his own nerdy humor. Quite a unique personality. His solutions are always very simple and beautiful. The last third of the book gets dense but that’s also because I stopped putting things in practice toward the end.
Profile Image for David.
Author1 book114 followers
August 12, 2009
A book with big cons and big pros. I think it will be easiest if I simply list the cons and the pros.

Let's start with the cons, all of which I attribute to editors asleep at the wheel or on crack:
1. The book is laid out in a reader-hostile manner: topics are introduced completely out-of-order. You'll be skipping around a lot to find in-depth answers for anything.
2. The index is worthless. You're rolling the dice when you try to find a particular topic. Chances are good it's not in the index.
3. Many important items are in a 20-page section entitled "5.4 Miscellaneous Short Topics." All of these topics could have been properly placed in appropriately-titled sections elsewhere in the book.
4. The syntax of the language is seemingly random to a newcomer. You never know if a line will need to end with a period, semicolon, or comma. By the time you're done with the book, you'll have figured all of this out. But I never came across a section describing the language syntax!
5. Much of the text of the book is Armstrong tooting Erlang's horn. I'm glad he likes it, but most of that should have been trimmed from the book.
6. There are a few errors in the source. This is always painful in a programming book.
7. Between the illogical structure of the book and the painfully unhelpful error messages from Erlang itself, getting through the thing can be a painful exercise.
8. Thankfully, I've already made a study of functional programming (i.e. immutable data, lambda, etc.) I think this book would be a challenging introduction to the subject, as it does not spend much time explaining the theory and practice.

Pros:
1. Armstrong really seems to enjoy showing off Erlang's features. The enthusiasm is nice.
2. There are some good examples in the book.
3. By the time you're done, you'll feel like you have a pretty good grasp of the language.
4. The language itself has a number of very interesting conceptual features. The book does do a good job of presenting what is advantageous and unique about Erlang.

In all, it's a decent book completely crippled by a complete lack of a good book editor. Since there is now an O'Reilly book called "Erlang Programming", I'd suggest taking a look at it instead. O'Reilly has good editors.

Strangely, I've noticed a propensity for Erlang supporters to confuse criticism of this book with criticism of Erlang (or even of functional programming in general!) itself. Please do not make that confusion here.
Profile Image for Adrian.
153 reviews28 followers
December 28, 2022
After having read all other books on this topic i still was amazed i found some new stuff here (distributed erlang, sockets).
The fundamentals are there and i liked there is not so much theory as to boggle you down.

Gets 3 stars instead of 4 because i found other books to be superior as a.starter (LYAE for intro, Cessarini's Programming Erlang for depth)
This entire review has been hidden because of spoilers.
Profile Image for Dale.
540 reviews67 followers
April 18, 2009
This is the definitive book on Erlang, written by Joe Armstrong, the creator of the Erlang language. The book is clearly written, with lots of small examples, and paced for the beginning Erlang programmer.

Erlang takes a little getting used to. It is a functional language, meaning that functions in general are unable to cause side-effects. For example, 'variables' are in one of 2 states: their initial state is 'unbound', their final state is 'has some value that can never change'. Attempting to place a value into a variable that already has a value causes an exception. This aspect of functional programming makes it possible to write multi-threaded/multi-process applications without the problems inherent in multi-threaded applications in non-functional languages.

The basic data types in Erlang are functions, atoms, numbers, lists, tuples, and strings (which are actually lists of integer numbers). List manipulation in Erlang is similar to that in Lisp: lists are generally treated as a head and tail. This is used by the Erlang way of defining functions: functions are defined as a set of pattern-matched expressions with code associated with each expression. For example, a simple accumulator in Erlang might look as follows:

total([H|T:]) -> H + total(T);
total([:]) -> 0;

total([1,10,20,5).
====> 36

This just says that to sum the values in a list, you add the value of the head of the list to the sum of the values in the tail, and that the sum of an empty list is zero.

Functions (lambdas, really, or 'funs' as they are called in Erlang) are first-class objects in Erlang, meaning that they can be members of tuples and lists, can be passed as parameters to functions, and can be returned as a value by functions. So, for example,

Double = fun(X) -> ( 2 * X ) end.

Double(5).
====> 10

Erlang was designed from the beginning to make it easy to write concurrent programs. Erlang process creation is very efficient, and there is no great difference between running such a program as many threads on one box or many processes on multiple boxes. A new process is created with the spawn function, which takes a fun (a lambda) as a paramter. The spawn function returns the process id (pid) of the new process, which may then be used to communicate with that process. The book shows a couple simple examples of distributed programming by way of illustration: a simple name server, and a stripped-down IRC server and client.

The book continues with details on how to interface C and Erlang software, how to communicate over TCP and UDP, the Erlang large-data storage mechanisms (ETS an DETS), and the Erlang database (mnesia).

There is a nice example of implementing map-reduce for disk indexing with Erlang on a multicore system.

Finally, there are a number of appendices including a large reference listing of the standard Erlang modules and functions.
Profile Image for Robert Postill.
128 reviews16 followers
October 29, 2012
I really wanted to write a lovely review of this not just because it's a prag prog book but also because I like the values espoused by the Erlang community. I had hoped for a tour de force from the language's creator but instead I got a book I skimmed the last hundred pages of.

So what's wrong with it? Half a dozen things, but the crucial thing is that the focus of the book wanes as the book progresses. In the early chapters there's a real feeling of purpose, but by the end you almost feel despondent as the author tries to motivate himself and you to try the best parts of the platform. The chapter on OTP is a classic example of the malaise, we get started with a simple server and as a reader you wait for the juicy details of how and why. Instead you get a kind of here's some more now go play with it yourself statement.

It should be noted that I didn't like the language much either and later chapters were tarnished by how annoyed I was by other things such as Erlang's string handling. So there may be some chicken and egg effect there.

Overall, I'd look to other books for the Erlang magic.
Profile Image for Austin Taylor.
33 reviews2 followers
Read
January 17, 2014
An adequate introduction to the language. Erlang is an important language, and it has enough unfamiliar elements to make it difficult to pick up without a guide. This book deserves credit for being a clear, approachable introduction to the syntax and core ideas of Erlang. However, he does not go as deep as I had hoped. His description of the language itself is thorough, but the chapters on OTP were relatively thin, and I am left with a number of questions about how to build and tune actual production systems with the Erlang toolset. He also doesn't get any extra points for style. I would recommend looking at the other Erlang books that are available.
Profile Image for Sri.
897 reviews37 followers
February 25, 2013
Membaca hingga bab 4 saja :). Cukup untuk membuat plugin kecil buat ejabberd.
Menarik membaca buku bahasa pemrograman dari pionirnya. Sebelum membaca buku ini sempat membaca tutorial online. Hasilnya, ya bisa sih kutak kutik di command prompt-nya tapi.... mengapa begini mengapa begitunya jadi ga paham-paham. Dengan membaca buku ini jadi lebih paham filosofinya *jiah*. Sayang hanya membaca sampai bab 4 saja (:|. Sekarang malah harus belajar Java ME dulu. Suatu saat nanti akan belajar Erlang lagi, yay! Demi konkurensi dan distribusi :D. Terlebih lagi demi keanehan functional programming.
57 reviews
October 17, 2022
This was the required reading for a course in Concurrent Programming in my university. Initially, I wasn't very enthusiastic about learning a new language, especially Erlang - I haven't seen it mentioned in a job posting and I would probably never use it in practice.
The concepts of Immutability and message passing got me by surprise and remained me of , so I decided to take the book more seriously. I managed to read and make all exercises from parts I, II, III and some from chapters of parts IV and V.

I think the book gives a good overview of the language and its functionalities. The approach of the author is inviting and enthusiastic, although it gets a bit terse at times. The exercises are a good addition to the text and successfully highlight many important concepts. There are a few small errors that I noticed, but nothing major. Finishing the text would give you a good foundational understanding of the language. This shouldn't be confused with actual experience in building solutions with it.

Last, but not least, my opinion is that developers experienced in other languages can benefit the most from the book. It requires some time spent constructing real-world software in order to appreciate what problems Erlang tries to solve and the particular solutions it has implemented. This view is somehow confirmed by my observation of the university class. Colleagues with less development experience had a harder time getting used to the functional approach, the language syntax and the peculiarities.

Profile Image for Otto Henrique.
76 reviews3 followers
May 26, 2022
Me interessei por esse livro para melhorar minha base em erlang/elixir. Acabei me confundindo um pouco no livro que queria para essa base, poís em algum sample que tenho no kindle tem uma apresentação mais completa das bases e história da VM, como por ex um capítulo contanto sobre a influencia de Prolog na linguagem - o que fica muito claro nas variáveis em letra maiúscula e construções como

```
f(A, B) ->
x = f1(A),
y = f2(b),
[x, y].
```

A primeira parte é uma introdução a linguagem e construções, padrão de livros de linguagens. Já a segunda faz um apanhado de libs, paralelismo e concorrência e diversas ferramentas da Erlang VM.

Mais um livro que funciona com uma primeira leitura para saber onde achar o conteúdo e novas leituras no futuro para entender realmente o que está sendo descrito, muito do que é apresentado acaba se perdendo se você não seguir os exemplos e exercícios.
56 reviews2 followers
October 2, 2017
This is a great book. As others have mentioned before, it is a bit chaotic at times, with understanding coming only after reading future chapters and with a few mistakes here and there, but this is made up for by the depth of the material and the positive energy of the author present on every page. If you can get through the tough parts, you'll be rewarded by a great explanation of how to build reliable systems based on immutable datastructures and message passing.
Profile Image for Juan Caballero.
55 reviews3 followers
May 22, 2020
Erlang is an amazing programming language. This book is not the best if you're learning functional or parallel programming (you should know both paradigms before reading this book; also you should have programmed many funcionalities in Java, .NET or any other so complete language), but it's handy if you're learning Erlang or modular programming. It's easy to get stuck, so take your time reading it.
Profile Image for Tatu.
7 reviews1 follower
November 9, 2022
I read the 1st edition. I like that the code still works, the mark of a good and stable tool.

Of course the environment has changed a lot after 2007 and the community has built lots more (building things with Makefiles seems quaint as there are better build tools that handle dependencies these days).

I like the structure, heavy on code samples and practical. Also gives a good tour of the Erlang facilities.
Profile Image for John.
2 reviews
August 8, 2018
It is an excellent book. I strongly advise anyone that wants to dive into Erlang to read this book. It is well-structured and covers the topics in an consise and joyful manner. I especially like how it keeps it real with references to real world cases. Personally, it makes me feel like I am taking a stroll down the rabbit hole into the wonders of the Erlang world.
1 review
September 21, 2017
Excellent book. The first book you should read if you are learning Erlang. The explanation is very clear without dumbing down the details. A classic book like K&R C, but for functional and concurrent programming.
Profile Image for Keyer.
1 review1 follower
August 11, 2010
It was a while since I wrote my first post. The reason is that I'm reading books parallel and it takes time to finish one in 100%. Although I'm digging trough some interesting materials since October which surely deserve mentioning here, the book I want to write about today hijacked my time pritty well last month, making me read it from the cover to cover in no time.
So here it goes: another book from the Pragmatic Bookshelf - "Programming Erlang - Software for a Concurrent World" by Joe Armstrong. I must admit that it is another position from this publisher that I've fallen in love with right away, so expect only kind words from this article.
So what areas does the book cover? Basically the fallowing:
Erlang as the language
Concepts of the functional programming
Concurrent programming using the Erlang Actor Model
Overview of interesting and sophisticated Erlang libraries.
In contrary to the first book I wrote about, "Programming Erlang" is rather long as it contains total of 519 pages . That number can be intimidating. Personally I'm scared of books longer than 250 pages. That was not the case here.
Fortunately, after reading through the Contents my fears has gone away. Introducing Erlang takes no more than 150 pages. Additionally it's really well illustrated with real life examples, so both new language and concepts of the functional programming comes in natural and pleasant process. Additionally, code you are guided trough (and which you will write fallowing the book) touches undoubtedly interesting subjects, like diagnosing mpg file, reading tags from mp3 file, streaming multimedia content via web or implementing simple concurrent communicator.
"So if that's all, what's on the next 370 pages?" you may ask. "More knowledge" I answer. But to be more precise there are two subjects covered in rest of the book: "serious concurrent Erlang programming" and "tools for serious concurrent Erlang programming". Knowing new language is one other, knowing how to use it to benefit from all its possibilities is the other. After learning you a new, great, functional language, Joe Armstrong takes you to a trip through newest concurrent programming approaches and techniques illustrated with even more interesting real world examples.
Of course there is not book that will make you a specialist in new language in two weeks, and no one should have any doubts on that. What "Programming Erlang" gives you is a wide entry into the Erlang world and preparing you to use it in your serious projects right away. All you need more is a little bit goggling and coding, coding and coding...
Profile Image for Tyler.
7 reviews
May 22, 2012
This seemed like a pretty good introduction to Erlang. I can't compare it to other Erlang books, as this is the first one I've read. I wish it was a little more concise and focused, and a bit more clear on where all the pieces fit together. For example, I'm not sure if I should try very hard to rely on OTP entirely for a distributed app, if I should use a library like lib_chan, or if should I stick directly to spawn, link and similar low-level functions.

Despite this qualm, I feel that I have a pretty good grasp of things after just a couple weeks of reading a book. This is a challenge, because Erlang is a fairly unique language. I'm looking forward to developing some nice, fault-tolerant, highly-concurrent programs.
Profile Image for Chris Maguire.
147 reviews6 followers
August 24, 2013
I've been programming with Erlang at work for 9 months already but the book has been a great back-filler and refresher. One key thing I'd forgotten is that generators in list comprehensions create Cartesian products: e.g.

> [{X, Y} || X <- [1,2,3], Y <- [a,b]].
[{1,a},{1,b},{2,a},{2,b},{3,a},{3,b}]
()

Armstrong (predictably) has a very thorough grasp of Erlang (having designed it back in 1986) but also has a relaxed style; for example when explaining how to pattern match on binary values Armstrong suggests working through the pattern with trial and error in the shell and then copying into your code; after this he writes, "That's what I do." I appreciate the humanity of his style.
Profile Image for OLASEMO OLADIPO A..
16 reviews
March 4, 2016
Didn't quite understand a large part of the examples in the book. But i get the general idea how powerful Erlang really is., will probably read the book once more while at the same time continue researching online and start up a full blown erlang project.

In my opinion that's the best way to truly learn a language.
Profile Image for Triplebyte.
17 reviews1 follower
July 20, 2017
"Its a great book to learn Erlang and to learn how to built fault tolerant distributed systems. Its easy to write distributed systems in Erlang because language supports it and take away all the complexity of writing similar concurrent systems in languages like Java/C++" � Himanshu N.
Profile Image for Bill.
43 reviews3 followers
April 10, 2016
For experienced programmers, it's a gem of a language-learning book. Up the learning curve smoothly.
Profile Image for Richie.
55 reviews1 follower
May 1, 2009
Nice book on Erlang language with some cool examples. I think these kinds of languages are the future of programming
Author9 books80 followers
May 29, 2010
Not a really well written book, but everyone's introduction to Erlang.
Profile Image for Michael.
162 reviews73 followers
October 13, 2010
Very good introduction to Erlang, covers all the important basics. Written in an easy to follow way, with mostly interesting examples and some exercises for the reader.
1 review
April 6, 2011
Great introduction to a beautiful language. Just the right size, involving informal style - plus comes from the language author imself!
Profile Image for Hussein.
13 reviews
November 10, 2013
Awesome book! Joe is a smart man and makes everything look easy. I liked the Sherlock case. Highly recommended book.
Profile Image for Łܰ첹.
23 reviews3 followers
March 11, 2015
It is good to look at the Erlang through the eyes of Joe (that was the main reason I read it).
Maybe it is good for beginners, but definitely not useful for practitioners.
Displaying 1 - 30 of 38 reviews

Can't find what you're looking for?

Get help and learn more about the design.