[MUD-Dev] TECH: programming languages (was: Re: TECH: STL / Heaps, etc.)

Bruce Mitchener bruce at puremagic.com
Thu Aug 16 08:47:42 CEST 2001


Federico Di Gregorio wrote:
> On 07 Aug 2001 10:31:30 -0600, Bruce Mitchener wrote:

>>  * Has anyone looked at using alternative method dispatch
>>  mechanisms, like predicate dispatch to simplify the
>>  implementation? (Predicate dispatch systems would be interesting
>>  to see used as the basis for an event system.)

> i don't know what you mean by "alternative method dispatch" but
> with i wrote aedon (http://initd.org/Software/aedon/) exactly to
> experiment with a different method to 'dispatch' actions on
> objects using a very bacic kind of fuzzy logic. see also the
> posting with subject "The Aedon rule system" on this list, some
> months ago.

Multiple dispatch is when the runtime (or compiler) looks up the
method based on the types of all of the arguments, not just the
receiving class.

Dylan, CLOS and other systems use multiple dispatch:

  http://www.gwydiondylan.org/gdref/tutorial/multiple-dispatch.html
  http://www.gwydiondylan.org/gdref/tutorial/singleton-dispatch.html

Or Perl:

  http://www.csse.monash.edu.au/~damian/TPC/1999/MultipleDispatch/

Or, more generally:

  http://citeseer.nj.nec.com/leavens98multiple.html

Predicate dispatch is a more general form of multiple dispatch and
looks at more than just the types of the args:

  From http://sdg.lcs.mit.edu/~mernst/pubs/gud-ecoop98-abstract.html:

     Predicate dispatching generalizes previous method
     dispatch mechanisms by permitting arbitrary
     predicates to control method applicability and by
     using logical implication between predicates as the
     overriding relationship. The method selected to
     handle a message send can depend not just on the
     classes of the arguments, as in ordinary object-
     oriented dispatch, but also on the classes of
     subcomponents, on an argument's state, and on
     relationships between objects. This simple
     mechanism subsumes and extends object-oriented
     single and multiple dispatch, ML-style pattern
     matching, predicate classes, and classifiers,
     which can all be regarded as syntactic sugar
     for predicate dispatching. This paper introduces
     predicate dispatching, gives motivating examples,
     and presents its static and dynamic semantics. An
     implementation of predicate dispatching is available.

Work on efficiently implementing predicate dispatch:

  http://www.cs.washington.edu/research/projects/cecil/www/Papers/dispatching.html

An interesting project that makes use of much of this is the Dynamic
Domain Architectures work:

  http://www.darpa.mil/ito/psum2000/J137-0.html

After all that ....

I think that predicate dispatch would be a very interesting approach
to writing some event dispatch code for handling resolution of
actions within the world, which -are- dependent upon a number of
factors and where it is desirable to be able to override behaviors
in a straightforward manner.

  - Bruce

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list