AGORA(ID:1794/ago001)Reifying prototyping OO languageis a prototype-based language solely based on message passing ("reifying"), developed at the Programming Tech Lab of Brussels Free University, Dept. of Computer Science. It incorporates features like method based inheritance, reflection and encapsulated inheritance of objects, and has a clean formal foundation. Structures: References: in [ECOOP] ECOOP '93 Conference Proceedings, Kaiserslautern, Germany, July, 1993 view details in SIGPLAN Notices 29(12) December 1994 view details in SIGPLAN Notices 29(12) December 1994 view details in [ECCOP 95] Proceedings of ECOOP'95, Springer-Verlag 1995 view details in [ECCOP 95] Proceedings of ECOOP'95, Springer-Verlag 1995 view details Introduction Usually, prototype based languages allow a wide variety of operations to be performed on objects. Examples of such operations are message sending, parent assignment, adding a slot to an object and cloning an object. Such operations are often designed without a general theory behind them. For this reason Agora was initially conceived as a prototype based language kernel based on objects and message sending alone (in the same way as pure functional languages are based on functions and function application alone). The original idea was to add other operations later on in an incremental fashion, in order to precisely determine which object-oriented features behave orthogonal and what kind of semantic constructions (in the implementation) are needed to support them. However, as the Agora project evolved, it became clear that besides message sending no additional operations are needed to obtain a full-fledged object-oriented language. We will argue that this simple message sending paradigm results in a lucid prototype- based programming language that is much safer than other prototype-based languages. It features a combination of controlled inheritance, controlled cloning and controlled reflective capabilities without neglecting the achievements of other prototype-based languages (such as dynamic object extension). It is the way these features are controlled by the language that makes Agora safe. We claim that this safety is an important prerequisite for prototype-based languages to become a viable alternative for the widely used class- based languages. Extract: Agora Language Definition Agora Language Definition Agora = Objects + Messages In Agora, user defined objects can be created by simply putting a sequence of valid message expressions between a pair of brackets. The semantics of such an "ex nihilo created object" is to create a new object and to evaluate each of its message expressions in the context of that new object. Agora features two kinds of messages expressions: ordinary messages and reifier messages. The evaluation strategy for ordinary messages is to send the message to the evaluated receiver with the evaluated arguments. This is much like function application in an applicative order functional language like Scheme. Reifier messages on the other hand can be seen as messages whose receiver and arguments are not necessarily evaluated. They thus correspond to the notion of reifier functions in 3-Lisp or special forms in Scheme. In the same way as special forms are `special functions' that are intercepted by the Scheme interpreter, reifier messages can be seen as `special messages' that are intercepted by the Agora interpreter. The Agora interpreter recognizes reifier messages by their boldfaced appearance. An example of a reifier message is the variable: message, which should be sent to an identifier and whose argument can be any valid Agora expression. The currently chosen implementation of the variable: message will evaluate its argument and will declare its receiving identifier in the 'current' object. This idea is illustrated in the following code fragment that defines an ex--nihilo created object containing a single instance variable x with initial value 10. [ x variable: 10 ] If we would employ the evaluation strategy for ordinary messages here, a "variable x not declared" error would occur. Like special forms make up the concrete syntax of Scheme, reifier messages define the particular flavour of Agora. The following section describes a subset of the currently implemented reifiers. An elaborate description can be found in the Agora user manual. in Cointe, P. editor, Proceedings of the Ninth European Conference on Object-Oriented Programming (ECOOP), July 1996. LNCS 1098, Springer-Verlag view details in Cointe, P. editor, Proceedings of the Ninth European Conference on Object-Oriented Programming (ECOOP), July 1996. LNCS 1098, Springer-Verlag view details Resources
|