AGORA(ID:1794/ago001)

Reifying prototyping OO language 


is 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:
  • De Meuter, Wolfgang "Nested Mixin-methods in Agora" view details
          in [ECOOP] ECOOP '93 Conference Proceedings, Kaiserslautern, Germany, July, 1993 view details
  • De Meuter, Wolfgang "Agora: Message Passing as a Foundation for Exploring OO Language Concepts" pp48-57 view details
          in SIGPLAN Notices 29(12) December 1994 view details
  • De Meuter, Wolfgang "Modular Inheritance of Objects Through Mixin-Methods" JMLC'94 Proceedings view details
          in SIGPLAN Notices 29(12) December 1994 view details
  • De Meuter, Wolfgang "A Marriage of Class- and Object-Based Inheritance Without Unwanted Children" view details
          in [ECCOP 95] Proceedings of ECOOP'95, Springer-Verlag 1995 view details
  • De Meuter, Wolfgang "Agora: The Story of the Simplest MOP in the world - or - The Scheme of Object-Orientation" view details
          in [ECCOP 95] Proceedings of ECOOP'95, Springer-Verlag 1995 view details
  • De Meuter, Wolfgang; Mens, Tom; Steyaert, Patrick "Agora: reintroducing safety in prototype-based languages" view details Abstract: Prototype-based languages are often described as being more flexible and expressive than class-based languages. This greater flexibility  makes prototype-based languages well-suited for rapid prototyping and  exploratory programming, but comes with a serious loss of safety. Examples of  this are the encapsulation problem and the prototype corruption problem most  prototype-based languages suffer from. These problems preclude prototype-  based languages from being widely used. We propose a prototype-based  language that eliminates these problems and thus reintroduces safety in  prototype-based languages. Extract: Introduction
    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
  • De Meuter, Wolfgang "Agora98: Reflective Programming in a Web Browser" 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
    • Agora page archived at WayBack
      Agora is a reflective prototype-based object-oriented programming language that is entirely (and solely!) based on message passing. Message passing is considered as one of the fundamental characteristics of object-oriented programming languages. It lies at the heart of late-binding polymorphism which is the key feature that makes incremental modification of programs possible. However, prototype-based languages often go beyond message passing. Deep down in their implementation, many things such as delegation, encapsulation, cloning and object concatenation can be found as explicit operations on objects. By making such languages reflective, these implementation operators also become visible to the programmer. As such, the programmer can easily bypass the message passing paradigm just by 'going meta'. Also, very often, these operators are an explicit feature in the language, even when reflection is not a language feature. We claim that these explicit operators on objects is the source of encapsulation problems, over-flexibility and the reason why it is so difficult to make abstractions in (reflective) prototype-based languages. We therefore designed Agora as a prototype-based object-oriented programming language whose only operation on objects is message passing. Agora shows that even within these limits, it is possible to build a full-fledged object-oriented language that features inheritance, cloning and reflective operators. The idea is that an object is fully encapsulated and can only be subject to message passing. But seen from the inside of the object, the object knows all about it's own structures. It is therefore perfectly capable of cloning and extending itself. This is accomplished by special methods we call cloning methods and mixin-methods. external link