Message Passing vs. Multi-Methods; Mixing the two?

Even though message passing can be thought of as a special case of the generic functions approach, there still seems to be something appealing about grouping procedure implementations and their shared data into logical units as in Smalltalk. I understand that polymorphic dispatch need not be conflated with program modularity / encapsulation, but for some reason it still feels like a good idea to me. I looked around this afternoon for a good discussion of multi-methods vs. message passing and came up empty, so I'm wondering if anyone could point me to one or share their thoughts on the issue.

I am interested in writing a lispy scripting language that integrates with the Apple's Cocoa environment, which is based on Smalltalk and therefore hardcore message-passing based. I would like a seamless connection into that world from this language. But I also want the power of multi-methods. I am imagining a language in which first-class namespaces could be blended with the Smalltalk approach to objects, exposing methods that respond to messages. But within these namespaces multi-methods could be used when they seemed appropriate. Therefore, in the large, the program would be assembled out of modules that resembled Smalltalk objects, but the implementation of methods exposed by these modules could have a lispier style. This is all very vague I know... and there's the obvious question of where multi-methods would belong. Any ideas?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

F-Script

If you want to write a programming language, you want to write a programming language - but you could just use F-Script.

F-Script

I had a look at F-Script and it was largely responsible for inspiring me to pursue making a language specifically for Cocoa. My main issue with it is that it doesn't seem to be featureful enough for my purposes. For example, you can't define new classes in F-Script, only glue together existing ones. I need a bit more power for the application I am interested in extending. Thanks though. F-Script is pretty interesting I agree and look well-executed for what it is.

Have a look at Slate

Slate has multimethods and prototypes. It has an appealing mental model of multimethods in terms of messages, that multimethods define how a group of objects respond to a message.

Best explained here

This weblog post is the most lucid explanation so far (and I'm Slate's designer!).

Brian, Slate is looking

Brian, Slate is looking really cool thus far. Good work. Maybe I can reappropriate it as my needed extension language.

Predicate Dispatching

What I'd like to see is how Predicate Dispatching fits in with message-passing, first-class messages, etc.