[Prev][Next][Index][Thread]
Re: Distributed objects vs. generic functions and multi-methods
On Tue, 2001-10-16 at 10:45, Scott McKay wrote:
> What has piqued my curiosity is, what does a good distributed
> object system look like in a language in which generic functions
> with multi-methods are the things around which designs are
> composed?
Not every language feature solves every problem equally well.
Multiple dispatch offers many advantages over traditional "message
passing" dispatch. But those advantages may not apply in all
application domains.
In distributed programming, objects may be on different machines. And
although the "recipient agnosticism" of multiple dispatch is usually a
huge win, it's doesn't give you any idea which server should run the
code.
So this looks like a small, localized loss to me, and not even a serious
one.
> I'm sure there are people who have thought about this. I would
> be very interested in what ideas you might have.
I think you're suffering undue agony. :-) Just slap together a "define
interface" macro, assume that the first argument to a remote function is
the target, and sleep easily.
Both macros and multiple dispatch are well-solved problems, and they
offer tremendous wins in lots of real-world designs. The fact that
weaker forms of dispatch are well-suited to certain programming idioms
shouldn't come as any suprise.
I /do/ think that there should be some way to declare the dispatching
and non-dispatching arguments of a generic function, however.
Cheers,
Eric
(who'd rather have the power and not need it, than vice versa)
References: