Justin R. Erenkrantz Where do you want to go today?

What is Eiffel?

Eiffel is an advanced object-oriented programming language that emphasizes the design and construction of high-quality and reusable software.

The Genesis of Eiffel

Dr. Bertrand Meyer and his corporation, Interactive Software Engineering (ISE) based in Goleta, California (a suburb of Santa Barbara), initially designed Eiffel. Eiffel was first conceived on September 14, 1985, but an implementation of the language did not appear until 1986. Eiffel was named after Gustave Eiffel, the engineer who designed the Eiffel tower.

The Rationale for Eiffel

Dr. Meyer drew the foundation for Eiffel from his heavy object-oriented background and previous work with Simula.

One of the most important strengths of Eiffel is that it is not a direct descendant from any other language. While Dr. Meyer heavily borrowed contemporary ideas, he did not directly base the syntax and behavior on any other current language. This is in stark contrast to C++ and Java (which rely heavily upon C constructs).

Dr. Meyer also introduced Design by Contract™ — a radical new important software engineering principle. Design by Contract™ is central to the wide-spread adoption and acceptance of Eiffel. Design by Contract™ is the formal definition of having pre-conditions and post-conditions for all functions in a program. For instance, a sort function’s contract may specify the pre-condition that all elements of the same type are in an array. The post-condition would specify that the array will be returned sorted (correctly). This allows the implementer of the sort function to utilize any algorithm as long as the pre-conditions and post-conditions are satisfied. As discussed in ICS 141 lecture, using this technique requires a strict definition of the requirements. Any ambiguities in the pre and post conditions will seriously cripple the system.

Variations and dialects of Eiffel

One of the major schisms in the Eiffel world is ISE’s (Dr. Meyer’s corporation) reluctance to release a free reference implementation. They have consistently charged for their Eiffel products, although they do have academic pricing available.

This policy is in sharp contrast to Java and C/C++ whose original implementers (Sun and Bjarne Strousoup, respectively) worked hard on releasing a free reference implementation of the language. They decided that it would be in the best interest of the programming language itself to seed the market with a solid implementation of the language. However, ISE’s reply to this complaint is that they could not initially afford to release Eiffel freely since ISE was a small start-up company and needed money to keep Eiffel alive. Sun and AT&T Labs (which paid Strousoup’s salary) could afford to allocate resources to nurturing the language through its infancy. Now, that Eiffel is so "successful," ISE believes that it does not make economic sense to release the product for free. Hence, ISE maintains to charge for their Eiffel implementation.

However, since 1995, an open-source Eiffel development system has been developed called SmallEiffel. SmallEiffel has now received the designation as the official GNU Eiffel Compiler from the Free Software Foundation. Contrary to the name, SmallEiffel is a complete implementation of Eiffel (it is actually a combination between SmallTalk and Eiffel).

In recent years, Java has emerged as the prime competitor to Eiffel. It shares similar object-oriented component techniques. In the December 2, 1997 article of PC Magazine, John Dvorak discussed Eiffel versus Java. However, Eiffel significantly predates Java by almost a decade, but Java has attained much more commercial support than Eiffel.

Technical details of Eiffel

The first thing when reading any Eiffel program is that the reader notices the predomination of English-based syntax in the code. The readability of Eiffel code by non-programmers is very high because of the keyword selection (among them: do, is, make, require, and repeat). Therefore, a non-programmer could easily verify the code at an extremely high-level. However, as the code descends into specificity, the code takes on the familiar unconventional programming notations such as ’:=’ for equals instead of using an equals keyword. Dr. Meyer attempted to balance human readability with syntactical efficiency. Syntactically, Eiffel looks very similar to Ada. Get Ada Core Technologies free Ada95 Compiler to compare the differences for yourself.

Eiffel supports virtual functions, virtual classes, overloading, and multiple-inheritance schemes. A virtual function or class is notated with the deferred keyword. When attempting to overload a non-virtual function, the programmer must make a forward declaration with the redefines keyword to indicate the intent to overload the function.

There is typically one class per source file. This is very similar to Java, but Java enforces one public class per source file - Eiffel does not have this distinction of a public or private class. However, some Eiffel implementations enforce this one class per source file, others may process all classes present in the file.

Like Ada, it has a specific predefined variable name for storing return values (Result). The keyword defining the current object is called Current (analogous to the this keyword in Java).

Implementations of Eiffel

Although the ISE and SmallEiffel implementations are the current market leaders, there are some other Eiffel implementations to note. iss-base and Visual Eiffel are two other Eiffel implementations that are used. Eiffel implementations have a high degree of portability - ISE supports both Win32 and most UNIX platforms; SmallEiffel supports any platform that has a ANSI C compiler or a working Java Virtual Machine. One of the interesting implementation techniques of some of the Eiffel compilers is that they "compile" the Eiffel code into ANSI C. This allows for flexibility when running the Eiffel program as almost all platforms have ANSI C compilers available. SmallEiffel is one of the few implementations that has built in support for Java byte code compilation - thus allowing the code to run on any JVM.

Applications for Eiffel

Eiffel has been used for financial applications, embedded systems, and educational purposes among other tasks. ISE has a web page dedicated to evangelizing Eiffel and its uses in real world projects.

Resources for Eiffel

Many books have been written about Eiffel. However, Dr. Meyer still remains the most prolific source of printed information for Eiffel. Object- Oriented Software Construction and Eiffel: The Language both by Dr. Meyer are required readings for any programmer attempting to learn Eiffel. Some other books to consider are Objects Unencapsulated: Java, Eiffel, and C++? by Ian Joyner, and Object- Oriented Software Engineering With Eiffel by Jean-Marc Jezequel.

On-line web sites dedicated to Eiffel

Sample Code

The following sample code is from the SmallEiffel Distribution. Since the source code is distributed under the GPL, it is reproduced here on this page with code annotations by the author of this web page.

References Used

Last Modified Friday, 20-Aug-2010 02:42:29 EDT These pages were made by Justin R. Erenkrantz unless otherwise stated. This work is licensed under a Creative Commons License. These pages will look best in an XHTML 1.0 compliant browser.

Creative Commons Attribution License Valid XHTML 1.0 Strict! Valid CSS!
[Blue Ribbon Campaign icon] [frdm] Support SFLC