Dylan

Appeared in:
early 1990s
Influenced by:
Paradigm:
Typing discipline:
Versions and implementations (Collapse all | Expand all):
Programming language

Dylan (from DYnamic LANguage) is a dynamic object-oriented language with support of functional and reflexive paradigms.

The language was developed in early 1990s by a group led by Apple Computers. It was intended for developing commercial software.

Presently there are two main implementations of the language: Open Dylan and Gwydion Dylan. Both of them are open-source and supported by a group called Gwydion Maintainers.

Dylan is derived from Lisp with elements of Smalltalk object system. Originally Dylan used Scheme-like syntax, but later it was replaced with Algol-style one.

Dylan’s version of object-oriented paradigm is somewhat specific. The concepts of library and module are separated; a library is compilation unit, while a module is import-unit: it defines a namespace and unites elements which should be used together. Methods of one class can belong to several modules, and programs can use different sets of methods for one class. Typically a class definition contains description of stored fields (“slots”), while methods are defined separately.

Language features:

  • all entities, including numbers and strings, are objects.
  • automatic garbage collection.
  • variables store not the values themselves but rather references to them; thus, all copies of one number point to the same object. Objects are destroyed as soon as all pointers to them are deleted.
  • methods can accept variable number of parameters and/or parameters of variable types.
  • multiple inheritance is allowed.
  • getters and setters are with predefined names automatically generated.
  • exception handling is provided. In case something happens, a program can signal a condition. Handlers describe how various conditions should be processed.

Examples:

Hello, World!:

Example for versions Gwydion Dylan 2.4.0

The first line is a header; it defines the module this file belongs to.

module: hello-world

format-out("Hello, World!\n");