Level: Introductory Gary Pollice, Professor of Practice, Worcester Polytechnic Institute
15 Dec 2007
from The Rational Edge: Read how Joe Armstrong's new book on programming in the Erlang language is a valuable resource for coders looking to solve concurrency issues.
From The Rational Edge.
Programming Erlang Software for a Concurrent World
by Joe Armstrong
The Pragmatic Programmers, 2007
ISBN 19343560X
Erlang is a functional programming language and runtime system that was designed at the Ericsson Computer Science Laboratory. It was designed especially for building fault-tolerant, real-time systems that can be deployed across a network. Erlang is designed to support concurrency naturally and easily. Erlang is now available as an open source system that runs on most computing platforms.
Joe Armstrong has written an excellent book on programming Erlang. The book is suitable for everyone from novices in functional languages to those who have experience with Erlang and want to improve their skills. This is not a reference manual, but a book to learn how to program using Erlang.
Armstrong organizes the book into twenty moderate-sized chapters and six appendices. The book seems shorter than its 515 pages. This is a tribute to Armstrong's easily readable writing style. I found myself taking a few minutes and reading a chapter or two just for the enjoyment. The best way to enjoy the book is to write some Erlang code as you go.
The first section of the book, chapters 1-6, presents the fundamental concepts of programming sequential programs in Erlang. The meat of this section is in chapters 2-6. The first chapter is really a preface. The second chapter tells you how to obtain and install the open source version of Erlang and make sure that it's working on your platform. If you have never programmed using a functional language, you should read the first six chapters carefully. If you're comfortable with functional languages you can easily scan these chapters and start with chapter 7.
Chapter 7 is, according to Armstrong, a "nontechnical chapter." He offers a short, five-page, introduction to concurrency. Two technical chapters follow that describe how to do concurrent programming in Erlang. Chapter 8 shows how to create processes, send messages between them, and so on. These are the basic operations you will need to master before moving ahead. Chapter 9 contains a detailed discussion of how to handle errors in concurrent programs.
Once you are comfortable with concurrency you're ready to take the next step -- distributed programming. These are programs that run on networks and require message passing. Chapter 10 is a short chapter that gives you the tools you need to write distributed programs in Erlang. Erlang has some special requirements, such as the "magic cookie" that allows two Erlang programs to communicate. When you finish this chapter, you're ready to become a distributed programming master.
Several of the next chapters stand by themselves. For example, chapter 11 describes an IRC program. Other chapters focus on specific topics such as working with files, sockets, and so on. Chapter 17 describes Mnesia, a database management system that supports replicated databases and is built into Erlang. Although Armstrong says that Mnesia queries look a lot like SQL, he omits the fact that the similarity only becomes apparent after you've become quite good with Erlang.
The final two chapters focus on programming multicore computers. This is the area that first caught my attention. These chapters give you some guidelines and examples that will help you write high-performance programs for multicore programs.
The six appendices cover an array of topics. If you're going to write Erlang programs, read Appendix A before you start. The title of the appendix is Documenting Our Program, but it's really a chapter on how to write readable code and follow established guidelines. The other appendices provide reference material and an extended example.
If you've tried functional programming and been turned off by it for any reason, you might want to give Erlang a look. If you're wondering how to master concurrency and distributed applications, you will find some great material in a very readable form. I highly recommend this book to all programmers. You will learn something from it.
Resources
About the author  | 
|  | Gary Pollice is a professor of practice at Worcester Polytechnic Institute, in Worcester, MA. He teaches software engineering, design, testing, and other computer science courses, and also directs student projects. Before entering the academic world, he spent more than thirty-five years developing various kinds of software, from business applications to compilers and tools. His last industry job was with IBM® Rational® Software, where he was known as "the RUP Curmudgeon" and was also a member of the original Rational Suite team. He is the primary author of Software Development for Small Teams: A RUP-Centric Approach, published by Addison-Wesley in 2004. He holds a B.A. in mathematics and an M.S. in computer science. |
Rate this page
|