ABC_logo ABC_logo SHOP_logo

Français

English

About us

Products

Librairies

Formations

Downloads

Contact

links

Demo ABC


Eiffel the language

Eiffel is an object-oriented (OO) programming language which emphasizes the production of robust software. Many find its syntax to be reminiscent of Pascal. Eiffel is strongly statically typed, with automatic memory management (typically implemented by garbage collection).

Developped from 1985, Eiffel is a mature OO language with development systems available from four different suppliers. Despite this maturity and a generally excellent reputation among those who are familiar with the language, Eiffel has failed to gain much interest from software developers. The reasons for this lack of interest are unclear, and are a topic of frequent discussion within the Eiffel community.

Distinguishing characteristics of Eiffel include Design by Contract, multiple inheritance and generic classes. Eiffel has a unified type system because even basic types are classes. In Eiffel, it is possible to create subclasses of the basic classes such as INTEGER.

Elegance, simplicity, or fascism?

The Eiffel language aims to promote clear and elegant coding. Eiffel emphasizes declarative statements over procedural code, and it eliminates the need for bookkeeping instructions.

Eiffel intentionally limits stylistic expression, providing few means for clever coding tricks or coding techniques intended as optimization hints to the compiler. Some software developers feel constrained by Eiffel's simplicity, sometimes to the extent of describing Eiffel programming as "bondage and discipline".

In contrast, others feel that the simplicity of the language not only makes the code more readable, but also allows a programmer to concentrate on the important aspects of a program without getting bogged down in implementation details. Eiffel's simplicity is intended to promote simple, readable, usable, reusable, reliable and correct answers to business problems. Eiffel seeks to produce a quality software system over anything else.

Syntactic simplicity

Eiffel has only six basic executable statements:

  • assignment
  • object creation
  • method call
  • conditional
  • iteration
  • choice (case)

Perhaps uniquely among the OO languages, Eiffel does not permit storing into member variables of other objects. The assignment statement can only change the value of a member variable of the current object, or a local variable of the current method. All changes to other objects must be accomplished by calls to methods of that object. Direct access to member variables of other objects is "read only" in Eiffel.

The iteration (loop) statement in Eiffel is unusual in that it does not provide a field or clause which will step the loop. The programmer must explicitly code the appropriate stepping statement within the loop. For example:

    from
        start
    until
        off
    loop
        Result.extend(item)
        forth
    end

The example above also illustrates another unusual aspect of Eiffel: there is no special syntax for accessing elements of an array. An array is simply an instance of the class ARRAY, and access is made through ordinary method calls. Some Eiffel compilers provide specialized optimizations for array access.

Eiffel's procedural coding is strictly structured. There are no Eiffel statements for terminating a loop early, nor for exiting a method early.

Non-OO operations

Eiffel is a purely object-oriented language. Any coding which must be "close to the machine" is expected to be done in C, and Eiffel provides a straightforward interface to the C routines, including allowing for straight C calls within Eiffel code. Eiffel tends to be quite closely connected to C; three of the four Eiffel compilers produce C code rather than object code.

Background of Eiffel

Eiffel was originally developed by Bertrand Meyer and his company Interactive Software Engineering (ISE). It closely follows Dr. Meyer's work in Object Oriented Software Construction, Second Edition. Eiffel differs from most popular languages in several ways.

The goal of the language, libraries, and programing methods is to create reliable, reusable software modules. It supports multiple inheritance, genericity, polymorphism,and encapsulation. Its most important contribution to software engineering is Design by Contract, in which assertions, preconditions, postconditions,and class invariants are used to assist in assuring program correctness without sacrificing efficiency.

Eiffel also offers multiple class inheritance. Many people (such as the designers of Java) have objections to multiple inheritance. The Eiffel implementation of multiple inheritance, in the opinion of its supporters, successfully meets these objections.

Eiffel's design is closely based on OOP theory, with less influence from other paradigms or support for legacy code. The language has formal support for abstract data types. In accordance with Self Documentation, a software text should be able to reproduce its design documentation from the text itself. Eiffel accomplishes this by using a formalized implementation of the Abstract Data Type.

Eiffel Studio, an integrated development environment for Eiffel, offers an object-oriented interface for software engineering. It is very different from user interfaces for other integrated development environments because it really match the OO programming concepts.

Hello World in Eiffel

class HELLO_WORLD
creation make
feature
   make is
      do
         print ("Hello, world!%N")
      end
end

Abstraction.ch all rights reserved