Google Answers Logo
View Question
 
Q: FOR EIFFEL-GA - What is the Eiffel Programming Language? ( Answered 5 out of 5 stars,   5 Comments )
Question  
Subject: FOR EIFFEL-GA - What is the Eiffel Programming Language?
Category: Computers > Programming
Asked by: cynthia-ga
List Price: $2.00
Posted: 28 Aug 2006 21:29 PDT
Expires: 27 Sep 2006 21:29 PDT
Question ID: 760352
EIFFEL-GA - I would like information about the Eiffel programming
language. What are the features and benefits, what niche applications
is it used for, and how can a program make it easier to write bug-free
code?

Just 5 minutes will make me happy! I would like a bit of commentary
explaining the Eiffel programming language --in laymans terms, please.
Answer  
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
Answered By: eiffel-ga on 29 Aug 2006 10:12 PDT
Rated:5 out of 5 stars
 
Hi Cynthia,

Thanks for your interesting question. It's interesting to me because
for the past fifteen years I have been developing software using the
Eiffel programming language.

Eiffel was invented twenty years ago by Bertrand Meyer, as a language
to foster software correctness and re-use.

Eiffel is a stronly-typed, statically-typed procedural object-oriented
language. It enhances software correctness by attempting to "engineer
out" as many sources of bugs as possible. For example, it was one of
the first mainstream languages to be garbage-collected and to offer a
wide range of dynamically-sized data structures. But that's not what's
special about Eiffel.

Eiffel pioneered the concept of "Design by Contract" - the idea that
you can include the specification of a routine together with the code
itself. Although this concept has since been offered as an add-on to
other languages, nowhere is it as effectively realized and as cleanly
integrated as with Eiffel.

Every routine can carry an explicit precondition and postcondition.
The precondition states under what conditions a routine can be validly
called. For example, a square root routine might require that it can
only be applied to non-negative numeric objects. The postcondition
specifies the result. For example, a square root routine might have a
postcondition specifying that the result squared equals the original
value.

There are also class invariants that must always hold (for example
"count >= 0"), plus loop invariants and loop variants to help ensure
that loops always terminate and produce the desired result.

The nice thing about Design By Contract is that it is well-integrated
throughout the language and the compilation process. The preconditions
demarcate responsibility between the programmer who designs a library
and the programmer who uses a library. No longer do the both need to
use defensive programming; and large applications suddenly become much
simpler. The contracts bind not only objects of the current class, but
also those of descendants. A descendant may offer a "better" service
by weakening the precondition or strengthening the postcondition, but
it is always substitutable. The contracts also integrate with
exception handling - a bug usually triggers a contract failure which
pinpoints the precise location in the code where the bug occurs (no
more endless hunting around with debuggers, memory checkers etc).

The syntax of Eiffel is very readable, though more verbose than most
modern programming languages. It favours readability and
maintainability even at the expense of taking more time to write the
first version. Eiffel programmers find the language a real pleasure to
program in.

So why hasn't Eiffel caught on big-time? It's hard to say for sure,
but there are a number of contributory factors. Eiffel appeals to the
modest programmer; the one who knows they can easily write bugs and
who actively seeks tools to help them write better code. It's not
going to be used by the "gung-ho" programmer who churns out code then
fixes bugs as they get reported by the end-users.

Eiffel also doesn't appeal to the project manager who produces screeds
of "bubbles-and-arrows" diagrams for management (in, e.g. UML) then
leaves the implementation problems to be sorted out by junior
programmers. In Eiffel, the contracts ARE the specification; all the
junior programmers need to do is to write an implementation that is
consistent with the (runtime-checked) specification.

So who uses Eiffel then? It's used for teaching in more than a handful
of Universities, of which two (ETH Zurich and Loria France) also
participate in compiler and language research and development. It's
used by a small number of software houses, such as Fury Software (a
game developer). But it's mostly used by very large organizations who
need to get a handle on their code, and for whom reliability is
essential. It's used for defense contracts, healthcare, stockmarket
analysis, cutting-edge financial applications such as derivatives
management, etc. For these organizations, Eiffel is so strategic that
they will pay around $5000 per developer for a commercial license.

There are also two open-source Eiffel compilers available. Once is a
simple but robust command-line compiler; the other is the same
software as the commercial version and includes a quirky but extremely
powerful and productive IDE.

So what does Eiffel code look like? I can't provide a full set of
examples with explanations in this answer, but here's a short excerpt.
It's the specification for 'prepend', one of the features ("methods")
of the STRING class:

        prepend (other: STRING) is
                        -- Prepend `other' to `Current'.
                require
                        other /= Void
                ensure
                        (old other.twin + old Current.twin).is_equal(Current)
                end

This is how you would see the feature when using the browser of the
IDE. But when you look at the underlying code you would see the
implementation too:

        prepend (other: STRING) is
                        -- Prepend `other' to `Current'.
                require
                        other /= Void
                local
                        i, j: INTEGER
                do
                        i := count
                        j := other.count
                        resize(i + j)
                        if i > 0 and then j > 0 then
                                storage.move(0, i - 1, j)
                        end
                        storage.copy_from(other.storage, j - 1)
                ensure
                        (old other.twin + old Current.twin).is_equal(Current)
                end

I trust this provides a feel for the "flavour" of Eiffel. If you have
any questions, feel free to request clarification.

Regards,
eiffel-ga


Links relating to Eiffel:

EiffelStudio commercial version:
http://eiffel.com/

EiffelStudio open-source version:
http://eiffelsoftware.origo.ethz.ch/index.php/Main_Page

SmartEiffel open-source compiler and libraries:
http://smarteiffel.loria.fr/

Eiffel Software Directory:
http://eiffelzone.com/esd/index.html

TeamEiffel blog:
http://teameiffel.blogspot.com/

38 Cool Ways to use Eiffel:
http://www.eiffel.com/developers/cool_things.html


Google Search Strategy:

eiffel -"eiffel tower"
://www.google.com/search?q=eiffel+-%22eiffel+tower%22


Disclosure: I maintain the Eiffel Software Directory and administer
the TeamEiffel blog, so my answer is not that of an unbiased outsider
(but you knew that already).
cynthia-ga rated this answer:5 out of 5 stars and gave an additional tip of: $2.00
Eiffel-ga provided me with an exceptional answer, a glimpse into a
programming language I never knew existed. Thanks!

Comments  
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
From: probonopublico-ga on 28 Aug 2006 21:36 PDT
 
Oh Cyndy

Why didn't you ask me?

I would have happily flown to Paris, climbed the monstrous eyesore,
and parlyed with the natives ...

JUST FOR YOU!

Saddened of Hove
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
From: myoarin-ga on 29 Aug 2006 07:03 PDT
 
Cynthia has been browsing web-owls.

Bryan, I used to feel the same way:  how could anyone want to see the
Eiffel Tower, much less actually be so utterly tourist and pay to go
up it.
I mean, [explitive], it looks like every postcard picture and all
those horrid souvenirs, not me!

But then I did one morning:  first, it is an immense edifice, really
impressive to approach;  second, it is filigran in a way I hadn't
imagined, a perfect combination of smaller and larger and even larger
girders, like the twigs and branches of a leafless tree, lacy, but so
clearly purposeful; third, the view from the top is great, like an
aerial photo or those cityscape drawings of the 19th century.

Of course, if you could take Cynthia, Pinkfreud, POly-guru or any one
of the better half of the G-A community with you, I am sure you
wouldn't hesitate to accompany her charmingly up Eiffel's Tower.
Myo
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
From: eiffel-ga on 29 Aug 2006 07:04 PDT
 
Bryan, you get to answer all the questions about the Probonopublico
Programming Language, OK?

Cynthia, thanks! I've been waiting since 2002 for someone to ask a
question about the Eiffel Programming Language at Google Answers! I've
just got to get the kids off to the dentist then I'll post the answer.

Regards,
eiffel-ga
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
From: probonopublico-ga on 29 Aug 2006 07:32 PDT
 
OK Eiffel .. It's a deal!

Actually, Myorin, I did have a delightful dinner in the Tower, many moons ago.

I remember it well because there was an astonishing Mind Reading Act:
she wandered around the tables, picking up various items and asking
him what they were.

He stood on stage, blindfolded, and always answered correctly and in
incredible detail.

She came to my table and asked if we had anything to test him with.
One of the diners produced his Passport and she asked 'What is it?'

After giving the required answer, she then asked ... What sort of
Passport? ... And what is holder's Name? ... And what is the Number?
... What is on Page 22? ... A Visa for where? ... When was it issued?
...What is the Passport Holder's Date of Birth? ... and so on ...

She didn't seem to be conveying any clues in her questions which were
direct and to the point ...

Now, if you can find out how it's done, we can put an act together ...
With you on stage, blinfolded; Pinkfreud moving among the audience;
and me collecting the dough.

We should do well!

Well?
Subject: Re: FOR EIFFEL-GA - What is the Eiffel Programming Language?
From: eiffel-ga on 29 Aug 2006 14:29 PDT
 
Thanks Cynthia, for the comments and kind tip.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy