Discovering Erlang, again

by Vladimir Piskarev

I recall it was a lot of fun when I was first investigating Erlang some time ago. Since then, I never had a chance to use it in production (unfortunately, non-curly-brace languages seem to avoid industry mainstream). But an overall feeling of grace of this language has remained in the back of my mind, and Erlang has been firmly set in the personal pantheon of the all-time greats (along with Smalltalk and CLOS), though some of its details have vanished through the course of time.

It seems I’m fortunate enough to have a very nice opportunity to get back and rediscover this great language. Having read the Part I of the 2nd edition of Joe Armstrong’s book, I’m once again impressed by the beauty of Erlang. I think it in many ways reflects some of the original OOP ideas by Alan Kay that went into the creation of Smalltalk-72 (which was one of the influences for the development of the Actor model).

It is known that Alan sort of apologized for having invented the term “object-oriented” and said that a better metaphor would be more “process-oriented”. Erlang seems to deliver exactly that with its notion of processes and associated primitives: spawn, send and receive. At a high level, it actually can be considered to be a (very pure) object-oriented language: it emphasizes messaging and fully supports encapsulation and polymorphism of processes (a.k.a. “real objects”). The pattern matching and functional programming facilities are just icing on this wonderful cake.

And yes, I’m having a lot of fun with it, again.

Advertisements