Eiffel (programming language)
Eiffel | |
---|---|
Publishing year: | 1985 |
Designer: | Bertrand Meyer |
Developer: | Bertrand Meyer and Eiffel Software |
Influenced by: | Ada , ALGOL , Simula |
Affected: | Ruby |
Operating system : | platform independent |
License : | GPL |
Eiffel is a universal, purely object-oriented programming language and was designed in 1985 by the French computer scientist Bertrand Meyer and his company Interactive Software Engineering Inc. ( Goleta , California ) as an alternative to C ++ . Originally it was only intended for use by your own company.
The programming language
The name Eiffel, a tribute to Gustave Eiffel , builder of the Eiffel Tower and one of the great engineers of the 19th century, documents the claim to have created a programming language with which software development according to the standards of engineering is made possible because it uses the knowledge of the software Engineering consistently implements.
In contrast to C ++, it is a completely new design that is not based on any older language. The declared aim of the development is to create a tool with Eiffel in order extensive software from reliable, reusable and easily maintainable and testable modules to construct . For this purpose, potentially risky programming options (manual memory management, global variables, undisciplined type conversions, direct pointer manipulation, Goto , etc.) are largely excluded, and optimizations (especially regarding execution speed , such as inline replacement ) are delegated to the compiler . The consistently object-oriented approach to design on a large scale is supplemented by the (rather strict) application of structured programming in detail, i.e. at the level of the individual routine (in Eiffel terminology: the individual "feature").
The syntax is influenced by Ada and the ALGOL language family (Algol, Pascal, Modula). Above all, it should be easy to read.
Eiffel's definition of language is public domain and is under the control of Nonprofit International Consortium for Eiffel (NICE) ; this organization has the right to validate any development tool for conformity with the language definition before it is allowed to bear the Eiffel name.
On June 21, 2005, the 89th General Assembly of the ECMA in Amsterdam adopted the standard ECMA-367 Eiffel Analysis, Design and Programming Language . It is the currently valid specification of the programming language, now called Eiffel Standard .
properties
- static type test
- automatic garbage collection
- Multiple inheritance ; Any name conflicts that arise can be resolved by renaming
- Abstract classes (so-called deferred classes )
- Generic classes (see templates in C ++)
- Polymorphism
- dynamic binding by default ; where possible, the compiler should optimize into more efficient static binding
- Elements of functional programming (tuples and so-called agents )
- (Prefix and infix) operators can be agreed like functions
- Exception handling
- Interface to other programming languages, especially C and C ++
- Standard library (comparable in scope to that of C ++)
One of Eiffel's specialties is supporting Design By Contract with development. For this purpose, the language provides differentiated means (preconditions and postconditions as well as invariants) to monitor classes, their individual functions as well as entire class hierarchies in a systematic way with assertions (which can be switched off ) for correctness of processes and states during runtime .
Security and Simplicity
- no overloading of functions and operators - a name or operator may not be defined more than once in a class
- only one universal loop type with explicitly specified variant and invariant (optional)
- no special syntax for indexing arrays and strings
- no distinction between “attributes” (variables) and functions without parameters for the user of a class
- Attributes of an object cannot be changed externally by assignment
- no program text outside of classes, therefore in particular no global variables
- Routines cannot change the value of their formal parameters
- Upper / lower case is not significant
- Semicolon is not required to separate statements
- separate namespaces for class names and other names
- neither a general jump instruction as
goto
still as specialcontinue
,break
,return
- no unsafe converting of types
- no pointer arithmetic
- Objects can only be at runtime
void
if explicitly required (called void safety )
Establishing an Eiffel program
An Eiffel program consists of only classes. Each class is its own module. During compilation, a root class is specified, of which an instance is created when the program is started.
Sample program in Eiffel
class HELLO -- Liberty-Eiffel
create
make
feature
make is
do
print("Hello World.%N")
end
end
class HELLO -- ECMA-Eiffel
create
make
feature
make
do
print("Hello World.%N")
end
end
Explanation
The class HELLO is created with class HELLO. The create clause defines the make method as a constructor. In this example make corresponds to the main method of Java . Which class is the root class and which method of this class is to be called first is defined in the configuration file (eiffel configuration file * .ecf) of the project. Without a constructor it is not possible to create an instance of the class.
application areas
The following areas of application for which Eiffel is particularly suitable are:
- safety-critical applications
- Design and specification
- Implementation of complex data structures
- Training in object-oriented programming
Compiler
The most popular compiler is EiffelStudio from Eiffel Software from the inventor of the language, Bertrand Meyer. EiffelStudio has also been licensed under the GPL since April 2006 (dual license system).
SmartEiffel (formerly SmallEiffel ) was once one of the most popular open source compilers for Eiffel. After the developers decided to give up compatibility with Eiffel and go in a different direction, the project has now been discontinued.
November 2013 the first official version of the SmartEiffel successor Liberty-Eiffel was released, next to Eiffelstudio and the GEC (from the Gobo class library), which is still in development , this is the last compiler for Eiffel that is still actively developed.
The development of the compilers Visual Eiffel and tecomp has been stopped.
To date, Eiffel has not been able to achieve the spread of C ++ or Java. Neither is any of the large software or IT companies behind Eiffel (as is the case with Java or .NET, for example).
The source code is usually compiled into the machine code of the target machine. This is done via the detour of converting the Eiffel sources into C code, with the exception of Visual Eiffel, which directly generates x86 code for Windows and Linux. The machine code generated in this way is, depending on the application, comparable to the corresponding C or C ++ code.
literature
- Frieder Monninger: Eiffel, Object-Oriented Programming in Practice . H. Heise Verlag, 1993
- Jean-Marc Jezequel: Object-Oriented Software Engineering with Eiffel . Addison-Wesley Professional, 1996
- Bertrand Meyer: Touch of Class - Learning to Program Well with Objects and Contracts . Springer, 2009
- Bertrand Meyer: Object-oriented Software Construction . 2nd ed., Prentice Hall, 1997
- Bertrand Meyer: Eiffel: The Language . Prentice Hall, 1992 - contains an older language definition of Eiffel. The work is currently being updated to the ECMA standard by Bertrand Meyer and will be named Standard Eiffel .
- R. Switzer: Eiffel: An Introduction . Prentice Hall, 1995
- Richard Wiener: Software Development Using Eiffel - There Can Be Life After C ++ . Prentice Hall, 1995
Web links
- ecma-international.org - The currently valid Eiffel standard.
- eiffel-nice.org - Non-profit organization for the further development, standardization and distribution of Eiffel.
- eiffel.com - Eiffel Software - Open Source Eiffel IDE for Windows, Linux, Mac OS X etc. a.
- sourceforge.net - The Eiffel Compiler (tecomp) - Open Source Eiffel Compiler
- gobosoft.com - The most important portable class library with support for complex data structures, Unicode, XML, parser etc. and a new open source Eiffel compiler.
- linux-magazin.de - German-language introduction to Eiffel
- smarteiffel.loria.fr - Open source implementation of an Eiffel-like language.
- visual-eiffel.org - another open source implementation that generates native code for X86 systems.
- B. Meyer: inf.ethz.ch (PDF) - explains the Eiffel concept.
- execve.net - Cetus Eiffel Page.
- Eiffel development environment goes open source . heise online
- liberty-eiffel.org - GNU successor to SmartEiffel.
Individual evidence
- ^ Liberty Eiffel
- ↑ tecomp
- ↑ Diploma thesis by Peter Haefliger at ETH Zurich (PDF; 723 kB)