BALANCING the Eulisp METAOBJECT PROTOCOL

BALANCING the Eulisp METAOBJECT PROTOCOL

LISP AND SYMBOLIC COMPUTATION An International Journal c Kluwer Academic Publishers Manufactured in The Netherlands Balancing the EuLisp Metaob ject Proto col y HARRY BRETTHAUER bretthauergmdde JURGEN KOPP koppgmdde German National Research Center for Computer Science GMD PO Box W Sankt Augustin FRG HARLEY DAVIS davisilogfr ILOG SA avenue Gal lieni Gentil ly France KEITH PLAYFORD kjpmathsbathacuk School of Mathematical Sciences University of Bath Bath BA AY UK Keywords Ob jectoriented Programming Language Design Abstract The challenge for the metaob ject proto col designer is to balance the con icting demands of eciency simplici ty and extensibil ity It is imp ossible to know all desired extensions in advance some of them will require greater functionality while oth ers require greater eciency In addition the proto col itself must b e suciently simple that it can b e fully do cumented and understo o d by those who need to use it This pap er presents the framework of a metaob ject proto col for EuLisp which provides expressiveness by a multileveled proto col and achieves eciency by static semantics for predened metaob jects and mo dularizin g their op erations The EuLisp mo dule system supp orts global optimizations of metaob ject applicati ons The metaob ject system itself is structured into mo dules taking into account the consequences for the compiler It provides introsp ective op erations as well as extension interfaces for various functionaliti es including new inheritance allo cation and slot access semantics While the overall goals and functionality are close to those of Kiczales et al the approach shows dierent emphases As a result time and space eciency as well as robustness have b een improved This article is a revised and extended version of y The work of this pap er was supp orted by the joint pro ject APPLY Ilog SA the University of Bath the British CouncilDAAD ARC program and the EuLisp working group The joint pro ject APPLY is funded by the German Federal Ministry for Research and Technology BMFT The partners in this pro ject are the University of Kiel the Fraun hofer Institute for Software Engineering and Systems Engineering ISST the German National Research Center for Computer Science GMD and VWGedas BRETTHAUER KOPP DAVIS PLAYFORD Intro duction Recently ob jectoriented languages with metaob ject proto cols have b egun to gain acceptance A metaob ject proto col extends the default semantics of an ob jectoriented language with an op en do cumented proto col allowing the programmer to extend the base language in directions appropriate for his application Instead of b ending the application to t the language the programmer b ends the language to t the application Ideally many such extensions can p eacefully co exist within the same basic framework the language will treat the extensions homogeneously Additionally metaob ject proto cols can provide generalized reective fa cilities which allow the construction of debugging environments insp ectors and other to ols which manage all ob jects via the same set of op erations The state of the art in metaob ject proto col design is b est describ ed in The Art of the Metaob ject Proto col by Gregor Kiczales Jim des Rivieres and Daniel G Bobrow Indeed it is still an art rather than a science to dene elegant and useful ob jectoriented programs and the problem is comp ounded for a program as general as a language Kiczales et al present an elab orate and tested metaob ject proto col MOP for the Common Lisp Ob ject System CLOS Furthermore they intro duce the essential problems to the reader and show various techniques which can b e used to solve them Op en questions and unsolved problems are presented to direct future work One of the main problems is to nd a b etter balance b etween expressive ness and ease of use on the one hand and eciency on the other Since the authors of this pap er and other memb ers of the EuLisp committee have b een engaged in the design and implementation of an ob ject system with a metaob ject proto col for EuLisp intended to correct some of the p erceived aws in CLOS to simplify it without losing any of its p ower and to provide the means more easily to implement it eciently The current status of this work is reected in the EuLisp denition The ob ject system TEO has b een implemented with minor variations in 1 the public domain EuLisp implementation FEEL in the commercially 1 available dialect LeLisp version in Common Lisp and in 1 Scheme TEO is used as the base for a set of articial intelligence and graphic programming to ols marketed by Ilog SA The exp ert system 2 workb ench babylon marketed by VWGedas uses MCS which is closely related to TEO Most of these to ols extend the kernel ob ject language provided by TEO using the metaob ject proto col 1 All three implementation s are available via anonymous ftp from host ftpbathacuk in the directory pubeulisp 2 MCS is available by anonymous ftp from langlispmcs on ftpgmdde BALANCING THE EuLisp METAOBJECT PROTOCOL This work builds not only on CLOS but also on a series of Europ ean work on simple reective ob jectoriented architectures in Lisp including work on ObjVLisp the Micro Flavor System Micro Common Fla vors and the Meta Class System MCS Design Context TEO is an integrated part of the EuLisp language denition In de scribing it we cannot completely isolate the ob ject system from the rest of the language There is a strong synergy b etween the rest of the language and the ob ject system esp ecially in the diverse ways that software engi neering goals are supp orted For example the division of work b etween classes and mo dules is discussed in more detail b elow EuLisps primary goal is to serve as a general programming language oering the traditional p ower of Lisp while taking the b est concepts from other languages and striving for the p ossibility of simple ecient imple mentations EuLisp features the following essential elements a mo dule system to supp ort separate compilation and encapsulation division into a core language and libraries to facilitate small applica tion development parallel pro cesses based on threads and semaphores for mo dern and future computer architectures a condition system for error handling downward continuations for exible control structures macros for syntactic extension an ob ject system based on classes and generic functions with simple default b ehavior and a metaob ject proto col All elements of the language except mo dules bindings and the predened syntax dening and sp ecial forms are represented by rstclass ob jects It is imp ossible to create or change a binding by computing its identier at runtime Although functions can b e generated dynamically at runtime all co de patterns are known at compiletime All of this helps generate small ecient applications allowing EuLisp to comp ete favorably with more traditional languages BRETTHAUER KOPP DAVIS PLAYFORD Design goals Certain design goals apply almost to all languages and systems These include robustness abstraction extensibility ease of use and eciency Kiczales et al claim to meet a numb er of these imp ortant design criteria Why is it hard or even imp ossible to meet all of them The cri teria are in practice contradictory if they must all b e met simultaneously However we can use the fact that the priority of the goals change dur ing the course of the software lifecycle to emphasize the most imp ortant goals at each lifecycle phase thereby reducing design goal conicts For example abstraction and ease of use apply mainly to the development and maintenance phases while eciency is essentially a runtime goal We prop ose the following classication of the ab ove goals Robustness The programmer must b e able to dep end on the do cumented function ality of dened mo dules in other words their semantic integrity must b e enforced Adapting them should not mean changing them since other mo d ules used in the same system might stop working as a consequence CLOS and Common Lisp generally violate this constraint through various redef inition facilities Instead we should distinguish b etween development time and execution time During development dynamic redenition is useful At execution time however the semantics of language entities should b e xed Since the development environment is not generally considered to b e appropriate for sp ecication we have little to say ab out the extended development capabilities oered by implementations However we would like to assure the programmer that he can write programs whose semantics is welldened Abstraction There should b e dierent levels of granularity in the proto col reect ing the dierent levels at which users need to think ab out the systems functionality and extend it Not all extensions are equal Some extensions require only small mo dications in b ehavior from the default while others are quite large The amount of work required to implement an extension should reect its scale Although the user should not have to know imple mentation details our exp erience shows that revealing appropriate details at appropriate levels often makes use easier A delicate question is the lowest level of detail which can b e revealed to allow p ortable and ecient implementations BALANCING THE EuLisp METAOBJECT PROTOCOL Extensibility The scop e of ob ject mo dels and implementations currently supp orted by various languages and to ols is quite large ranging from classless prototyp e based systems like Self to the complex intricate mo dels supp orted

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    19 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us