05.08.2014 Views

here - Stefan-Marr.de

here - Stefan-Marr.de

here - Stefan-Marr.de

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5. An Ownership-based MOP for Expressing Concurrency Abstractions<br />

5.1. Open Implementations and Metaobject Protocols<br />

Consi<strong>de</strong>ring the requirements i<strong>de</strong>ntified in Sec. 3.4 and that the contemporary<br />

multi-language VMs are object-oriented programming environments (cf.<br />

Sec. 3.1.1.2), reflective programming techniques provi<strong>de</strong> the natural foundation<br />

for a program to interface with a VM, i. e., its runtime environment. Thus,<br />

this section briefly reviews the notion of open implementations and metaobject<br />

protocols, because they are commonly used to provi<strong>de</strong> properties similar to the<br />

ones required for a unifying substrate for concurrent programming concepts.<br />

The notion of open implementations <strong>de</strong>scribed by Kiczales [1996] provi<strong>de</strong>s<br />

a general <strong>de</strong>sign strategy for increasing the control that client co<strong>de</strong> has over<br />

a software component it is using. The general motivation is that client co<strong>de</strong><br />

often needs to adapt or work around the concrete software component it is<br />

using, to change semantics or performance characteristics to the context it is<br />

used in. Thus, open implementations are <strong>de</strong>signed to facilitate the adaptation<br />

of implementation strategies [Kiczales et al., 1997]. This notion can also be<br />

used to enable adaptive language guarantees and semantics based on a meta<br />

interface. Meta interfaces for this purpose are commonly known as metaobject<br />

protocols:<br />

Metaobject protocols are interfaces to the language that give users the<br />

ability to incrementally modify the language’s behavior and implementation,<br />

as well as the ability to write programs within the language.<br />

[Kiczales et al., 1991, p. 1]<br />

Introduction Today, metaobject protocols (MOPs) can be found in a number<br />

of languages, for instance in the Common Lisp Object System (CLOS),<br />

Smalltalk-80 [Goldberg and Robson, 1983], Groovy, 1 and Perl’s Moose object<br />

system. 2 While not all of them offer the full functionality of the MOP discussed<br />

by Kiczales et al. [1991], they provi<strong>de</strong> capabilities to reflect on the<br />

executing program and adapt the language’s behavior.<br />

To start from the beginning, important foundations for MOPs are the notions<br />

of reflection and reification [Friedman and Wand, 1984]. Reflection builds<br />

on introspection and intercession. Introspection is the notion of having a program<br />

querying itself for information. This information is then reified in terms<br />

of program structures which can be processed. Based on these reified program<br />

structures, intercession enables the program to interfere with its own<br />

1 http://groovy.co<strong>de</strong>haus.org/<br />

2 http://search.cpan.org/~flora/Class-MOP/<br />

110

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!