Objectives

This section focuses on class-less, prototype-based languages. These languages may increasingly become important for exploratory programming and the implementation of intrinsically dynamic systems, such as hypermedia systems. The language Self is discussed as an example of a class-less language supporting delegation.

Points to emphasize

Hints

It is important to stress the distinction between inheritance and delegation. Inheritance is intrinsically a static mechanism, resulting in creation-time sharing, whereas delegation is dynamic, resulting in lifetime sharing.

Questions

  1. How would you characterize prototype-based languages?
  2. What are the differences between inheritance and delegation?
  3. Does C++ support delegation? Explain.

Comments

Dynamic compilation is an intriguing issue. It is interesting to note the convergence between, for example, C++ and Self. This convergence shows the difficulty in finding a suitable compromise between efficiency and dynamic type information.