Eiffel is an object-oriented programming language designed by Bertrand Meyer (an object-orientation proponent and author of Object-Oriented Software Construction) and developed by Eiffel Software. Meyer conceived the language in 1985 with the goal of increasing the reliability of commercial software development. The first version was released in 1986.
Overview
Eiffel is a statically typed, class-based, multi-paradigm language that supports generic programming and concurrency. The design of the language is closely connected with the Eiffel programming method, both being based on principles including design by contract, command–query separation, the uniform-access principle, the single-choice principle, the open–closed principle, and option–operand separation.
The language was standardized internationally: the International Organization for Standardization (ISO) released a technical standard for Eiffel in 2005, and ECMA International approved Standard ECMA-367 (Eiffel: Analysis, Design and Programming Language) in June 2005.
Key characteristics
Eiffel's defining characteristics include:
- Design by contract: Assertions, preconditions, postconditions, and class invariants are tightly integrated with the language to help ensure program correctness.
- Automatic memory management, typically implemented via garbage collection.
- Multiple inheritance, including renaming, redefinition, selection, non-conforming inheritance, and other mechanisms intended to make inheritance safe.
- Constrained and unconstrained generic programming.
- A uniform type system in which all types, including basic types such as INTEGER, are class-based and handle both value and reference semantics.
- Static typing.
- Void safety (static protection against calls on null references) through the attached-types mechanism.
- Agents, which are objects that wrap computations, closely connected with closures and lambda calculus.
- Once routines, which are evaluated only once, for object sharing and decentralized initialization.
- Case-insensitive, keyword-based syntax in the ALGOL/Pascal tradition, with semicolons being optional.
Design goals
Eiffel emphasizes declarative statements over procedural code and attempts to eliminate the need for bookkeeping instructions. It shuns coding tricks intended as optimization hints, aiming instead for code readability and concentration on essential program aspects. The language's simplicity is intended to promote simple, extensible, reusable, and reliable solutions to computing problems. Compilers provide extensive optimizing techniques, such as automatic inline expansion, to reduce the optimization burden on programmers.
Implementations and environments
EiffelStudio is an integrated development environment available under either an open-source or a commercial license. It offers an object-oriented environment for software engineering and compiles to either C or .NET. EiffelEnvision is a plug-in for Microsoft Visual Studio. Other open-source implementations include "The Eiffel Compiler" (tecomp), Gobo Eiffel, SmartEiffel (the GNU implementation based on an older version of the language), LibertyEiffel (based on the SmartEiffel compiler), and Visual Eiffel.
Influence on other languages
Several concepts initially introduced by Eiffel were later incorporated into Java, C#, D, Ruby, Scala, Sather, Racket, Ada 2012, and other languages. Sather, for example, was originally based on Eiffel but has since diverged. The interactive-teaching language Blue (the forerunner of BlueJ) is also Eiffel-based, as is the Apple Media Language.
Example ("Hello, world!")
A "Hello, world!" program written in Eiffel might look like:
class
HELLO_WORLD
create
make
feature
make
do
print ("Hello, world!%N")
end
end
References
- Meyer, Bertrand (1997). Object-Oriented Software Construction (2nd ed.). Prentice Hall. ISBN 0-13-629155-4.
- ECMA International. Standard ECMA-367 – Eiffel: Analysis, Design and Programming Language (2nd ed., June 2006).
- Meyer, Bertrand (2009). Touch of Class: Learning to Program Well with Objects and Contracts. Springer-Verlag. ISBN 978-3-540-92144-8.
- Meyer, Bertrand (1992). Eiffel: The Language. Prentice Hall.