vladimir piskarev's blog

Musings on the Eclipse Handly project and software development in general

Category: Personal Reflections

Discovering Erlang, again

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.


Welcome to my blog

This should have probably been my opening post. A personal weblog often contains an introductory entry about what inspired its creation; its intended focus; its author and his interests; etc. However, in the first post, it has been more important to me to talk about the Eclipse Handly proposal, which I find very exciting and which actually inspired me to start blogging for the first time in my life. The Handly project and open source in general will remain the primary focus of this site, but this is a personal blog after all and I reserve the right to publish occasional reflections of me under an appropriate category in a lame attempt to amuse the reader.

I was thinking of the question — should I introduce my humble self in the hope of facilitating socialization and if I should, then how? My current status is presented on the About page. I might add that I’m a big fan of Beethoven, though I enjoy Trout Mask Replica too. Still, I wanted to convey something that not only could characterize my personality in some respects, but also was more fitting to the intended focus of this blog.

Finally, I thought that a better way to introduce myself might be to reflect on my personal heroes in computer science and their powerful ideas that have informed my interests and, in large part, my thinking. I already mentioned Alan Kay when I was musing on scalability. Now is the turn of another hero, also of Xerox PARC fame. His name is Gregor Kiczales.

Gregor is, of course, widely known for aspect-oriented programming and AspectJ (actually, he coined the term “crosscutting”), but it’s his fantastic, though perhaps slightly less known work on the metaobject protocol approach and its unsurpassed manifestation in Common Lisp Object System (CLOS) that, to me, is even more important. I can only repeat the Alan Kay’s recommendation for the profound book “The Art of the Metaobject Protocol” by Gregor Kiczales, Jim des Rivières and Daniel G. Bobrow. That book must have been one of the most significant revelations in my life. It thoroughly introduces the concepts of metaobject protocol design, but to me, the most remarkable has been the very idea of “opening languages up” for achieving that exquisite blend of elegance and efficiency, beauty and practicality. If you read it, you will never be the same again.

On scalability and why it’s so important

I’m not going to say anything really new here. Rather, it’s a way to summarize thoughts on that, quite important to me, matter.

I have a deep interest in object-oriented programming; more in the original idea than in any specific implementation (though I find Smalltalk to be an execution par excellence) or methodology (however helpful design patterns can be). I was immensely impressed by Alan Kay’s talk at OOPSLA 97. Here’s the link. I continue to enjoy it every time I’m reading it. It’s influential, to say the least. Without doubt, Alan is one of the most important thinkers of our time, probably of all time.

Of course, the central idea underlying object-oriented programming is how we can deal with large-scale structures effectively. It’s all about scalability. As Alan Kay excellently put it: “As size and complexity increase, architecture always dominates materials”. When ARPANET was being designed in the sixties, its designers thought deeply about scalability of “the intergalactic network” — the result is, of course, the Internet as we know it — probably, the largest structure ever made by the human.

Now, many seem to be concerned more about performance than scalability. Some may even believe it’s the same thing. It’s hard to say why this syndrome is so deeply embedded in our nature, as programmers. Indeed, system programmers may be thought of as “high priests of a low cult”. The cult is, of course, optimization. But the irony is that staying in the “pink plane”, strongly focused on optimization, we are often optimizing something that can’t be optimized very much. While such optimization can bring tangible tactical benefits, it can also bring much less tangible, but strategic losses (skewed design, closed options, hard to maintain inflated code base, etc.). In contrast, thoroughly thinking about scalability is strategically important, though perhaps less perceivable tactically. When a first Smalltalk took a while to compute “3 plus 4”, Alan could not care less. He knew about the Moore’s law and designed for scalability, not for performance per se. The rest is history.

“If you think programming is small, that’s why your programs are so big.” Our industry as a whole could benefit if we begin to think more deeply about all aspects of scalability when doing system design. And that’s the main lesson from Alan Curtis Kay, to me.

P.S. Once you start blogging, it’s hard to stop. That’s why I’ve long resisted creating a personal blog. Now it’s frightening to think what will happen when I discover Facebook and Twitter.