Mμl: The Power of Dynamic Multi-Methods

10/01/2019
by   Isaac Oscar Gariano, et al.
0

Multi-methods are a straightforward extension of traditional (single) dynamic dispatch, which is the core of most object oriented languages. With multi-methods, a method call will select an appropriate implementation based on the values of multiple arguments, and not just the first/receiver. Language support for both single and multiple dispatch is typically designed to be used in conjunction with other object oriented features, in particular classes and inheritance. But are these extra features really necessary? Mμl is a dynamic language designed to be as simple as possible but still supporting flexible abstraction and polymorphism. Mμl provides only two forms of abstraction: (object) identities and (multi) methods. In Mμl method calls are dispatched based on the identity of arguments, as well as what other methods are defined on them. In order to keep Mμls design simple, when multiple method definitions are applicable, the most recently defined one is chosen, not the most specific (as is conventional with dynamic dispatch). In this paper we show how by defining methods at runtime, we obtain much of the power of classes and meta object protocols, in particular the ability to dynamically modify the state and behaviour of 'classes' of objects.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

11/01/2018

Algorithms for Runtime Generation of Homogeneous Classes of Objects

This paper contains analysis of main modern approaches to dynamic code g...
04/17/2018

Metaclasses and Reflection in Smalltalk

Many Object Oriented Programming Languages provide reflective features w...
01/07/2016

Fuzzy Object-Oriented Dynamic Networks. I

The concepts of fuzzy objects and their classes are described that make ...
02/22/2020

Modeling the Invariance of Virtual Pointers in LLVM

Devirtualization is a compiler optimization that replaces indirect (virt...
02/01/2019

Shallow EDSLs and Object-Oriented Programming: Beyond Simple Compositionality

Context: Embedded Domain-Specific Languages (EDSLs) are a common and wid...
07/10/2019

CallE: An Effect System for Method Calls

Effect systems are used to statically reason about the effects an expres...
08/04/2017

Scoped Extension Methods in Dynamically-Typed Languages

Context. An extension method is a method declared in a package other tha...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.