Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Sun, 09 May 2004
Programming without a call stack
Ted Neward had an interesting comment on one of the talks at TheServerSide Symposium:
[23:20] |
[computers/programming] |
# |
TB |
F |
G |
6 Comments |
Every developer on the planet, both Java and .NET, needs to stop and think about ways to focus on messaging, even between classes, rather than straight method calls, not because this is the silver bullet that solves all your concurrency issues, but that in certain cases it can certainly reduce them.Using "real messages" (as opposed to calling function calls messages) to communicate between objects was a feature of the Actor model of computation invented by Carl Hewitt. I spent a little bit of time on Actors. I took 6.835 my senior year at MIT, and when I went to Brown I was originally interested in working on Actor language problems before I got diverted off into object database stuff. There's another interesting tie-in. I was reading Carlos' post on designing usable API's, which referred to the Curried Object pattern. The Curried Object pattern feels very Actorish to me. The notion of returning an appropriate intermediary is very much like the become step of an actor computation. Of course, the notion of an object with just the right set of methods (my interpretation of "an appropriate intermediary") feels sort of like a capability. As you can see, a number of things have been swirling around in my brain...
Smalltalk is 'message oriented' in that you send messages to objects instead of making method calls. Messages can be objects as well called a Message. There is a subclass of it called DirectedMessage which is linked to a receiver, making a repeatable message send object. Distributed Objects in Smalltalk for VisualWorks and Opentalk work by sending a Message object across the network to be acted upon on the other side.
Posted by Michael Lucas-Smith at Mon May 10 00:42:40 2004
Posted by Michael Lucas-Smith at Mon May 10 00:42:40 2004
I believe IOLanguage uses Actors for concurrent processing, and looking at the code samples it looks quite smalltalkish.
Posted by gab at Mon May 10 03:06:13 2004
Posted by gab at Mon May 10 03:06:13 2004
oops should have looked deeper, mr. dekorte is the guy behind IO :)
Posted by gab at Mon May 10 04:48:46 2004
Posted by gab at Mon May 10 04:48:46 2004
Smalltalk is not message-oriented. It has methods that are called "messages", just like C++ methods are called "member functions", but the similarity stops there. There is no asynchronism, no futures and none of the other features in Smalltalk that make a language "actorish".
--
Cedric
Posted by Cedric at Mon May 10 21:49:20 2004
--
Cedric
Posted by Cedric at Mon May 10 21:49:20 2004
It is not "just like C++". Smalltalk has a real message object, which can be sent later, and it also has built in support for multiprocessing. Blocks also support the notion of behavior to invoke later. Wan't to implement futures for your application? Trivial. Interestingly, if you wanted to design your system to retry a method call at some later time if it fails, it is easy to do so in Smalltalk because the system reifies the method call as an instance of Message in this case. Try that in C++.
Posted by Carl Gundel at Tue May 11 08:02:55 2004
Posted by Carl Gundel at Tue May 11 08:02:55 2004
The key aspect of actors is that every actor could run on a separate processor. This means that every actor has a queue of messages that it processes asynchronously. This is the style that Neward was advocating, but not the setting (fine grained concurrent multiprocessing). That's not really the same thing as Smalltalk, although I have no doubt that Smalltalk is far ahead of C++ and Java as far as reifying messages.
Posted by Ted Leung at Tue May 11 21:19:12 2004
Posted by Ted Leung at Tue May 11 21:19:12 2004
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk