"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Loading...

Monday, April 19, 2004

Comparing Erlang and Smalltalk

Bill de Hora compares Erlang and Smalltalk message passing...
Joe Armstrong describes Erlang as a concurrent pure message passing language. Which might be characterized as Smalltalk on steroids. There's a lot of confusion around what is meant by 'message passing' in Smalltalk. Conceptually I think Smalltalkers are talking about message queue type messaging and in some cases asynchrony, but physically I understand Smalltalk works like Java or C++, i.e. it's jumptables, and pointers all the way down. Hence the confusion, but I trust someone will correct me if I'm wrong about this.
Yes, in Smalltalk a "message pass" is a synchrononous action. The mechanism is more flexible than with Java-like languages... the receiver has the opportunity to intercept the message. But yes, it is a synchronous "request/reply".

I think this is more a result of the original implementations of Smalltalk in the 1970's rather than a specific desire by Kay, et al. My guess is they were more concerned with encapsulation and less concerned or even knowledgable of the asynchrony issues. Although process classes have been around since then, so I should go back and read the paper. From the early history by Kay, emphasis is mine...

Smalltalk's design--and existence--is due to the insight that everything we can describe can be represented by the recursive composition of a single kind of behavioral building block that hides its combination of state and process inside itself and can be dealt with only through the exchange of messages.
Interesting experiments have been done making deliberately asynchronous Smalltalk-like languages, specifically with the Actors languages at MIT, UIUC, Japan, and elsewhere. (Intersting side note is the prevalence of continuations in these designs.)

Yes, programming in Erlang message loops is a lot like designing cooperative "active objects".

No comments:

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.