comp.lang.ada
 help / color / mirror / Atom feed
From: fred@genesis.demon.co.uk (Lawrence Kirby)
Subject: Re: The disturbing myth of Eiffel portability
Date: 1996/11/17
Date: 1996-11-17T00:00:00+00:00	[thread overview]
Message-ID: <848251228snz@genesis.demon.co.uk> (raw)
In-Reply-To: 3294e64b.74799475@news2.ibm.net


In article <3294e64b.74799475@news2.ibm.net>
           cjames3@ibm.net "The Rt Rev'd Colin James III, KOTM 1/96" writes:

>It is common knowledge that the same ANSI C source code when compiled by
>different ANSI C compilers produces executables which when run yield
>different, inconsistent floating point results.  

They should not be inconsistent for correctly written code. What can differ
is the accuracy of the results. That results aren't exact in general is a
fact of life with floating point.

>This is due to the fact that the runtime floating point packages of ANSI C
>compilers vary as to word size and are not required to conform to strict
>standards, other than weasel words, as are Ada compilers.

ANSI C does define minimum precision and other requirement for floating
point types. The only question is whether they are adequate for your needs.
ANSI C compilers on many platforms conform to the relevant IEEE floating
point formats so if this is a big issue for you simply specify that your
code is only certified for, say, an ANSI + IEEE 754 compliant platform.

>Eiffel emits ANSI C code.
>
>Therefore Eiffel is in fact not truly portable and can in fact yield
>different numerical results according to platform.

It depends what the actual specs for floating point in Eiffel are. If they
are stricter than those in ANSI C then not all implementations of Eiffel
may be compliant with its specs. You don't certify code for such
platforms.

>That begs the following question:  how can the largest Eiffel project of
>over 700,000 lines of code (the CALfp bank's derivatives' program) expect
>to be taken seriously if the source code when compiled on different
>platforms could produce inconsistent and erroneous results.  

You have yet to establish that it does.

>In other words, the reason that banks generally have learned to avoid C due
>to floating point problems is not solved at all but rather propagated and
>worsened by the questionable strategic decision to adopt Eiffel.  That fact
>may of course explain why no other famous banks with both US _and_ European
>computer operations have jumped on the Eiffel bandwagon and predictably
>would not, such as the perfect example of CitiCorp which had the first GE
>bank computers about 1962.

Can you think of a platform that a bank is likely to adopt these days
for hosting Eiffel that doesn't support suitable floating point formats?

>Don Knuth tried to get around the floating point problem in the 1960's by
>suggesting in Volumes 1 and 2 of his opus to use scaled integers.  It's too
>bad that the immature project weenies choose not to read that classic
>anymore these days and thus don't know the meaning of integer math.

5-10 years ago I might have agreed with you. However IEEE formats have
been generally adopted and do guarantee exact results for calculations
on integers that can be represented exactly.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------





  reply	other threads:[~1996-11-17  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-15  0:00 The disturbing myth of Eiffel portability The Rt Rev'd Colin James III, KOTM 1/96
1996-11-17  0:00 ` Lawrence Kirby [this message]
1996-11-17  0:00 ` Eoin Woods
1996-11-17  0:00 ` The Rt Rev'd Colin James III, KOTM 1/96
1996-11-18  0:00   ` James Youngman
1996-11-20  0:00     ` Piercarlo Grandi
1996-11-21  0:00       ` Paul Johnson
1996-11-27  0:00         ` Piercarlo Grandi
1996-11-28  0:00           ` Don Harrison
1996-11-29  0:00             ` Piercarlo Grandi
1996-11-29  0:00               ` Robert Dewar
1996-11-29  0:00               ` Robert Dewar
1996-11-29  0:00             ` Piercarlo Grandi
1996-11-29  0:00               ` Don Harrison
1996-11-30  0:00                 ` Piercarlo Grandi
1996-12-01  0:00                 ` Jon S Anthony
1996-12-02  0:00                   ` Piercarlo Grandi
1996-11-20  0:00   ` Jeff Miller
1996-11-20  0:00     ` Piercarlo Grandi
1996-11-18  0:00 ` Stephen J Bevan
1996-11-19  0:00 ` Kaz Kylheku
1996-11-19  0:00   ` Robert Dewar
1996-11-20  0:00     ` Matt Kennel
1996-11-22  0:00       ` Robert Dewar
1996-11-20  0:00     ` Larry Kilgallen
1996-11-21  0:00       ` Robert Dewar
1996-11-22  0:00         ` Larry Kilgallen
1996-11-22  0:00           ` Robert Dewar
1996-12-01  0:00             ` Graham C. Hughes
1996-12-01  0:00               ` Robert Dewar
1996-12-02  0:00                 ` Brian R. Hanson
1996-12-06  0:00                   ` Robert Dewar
1996-12-09  0:00                     ` Brian R. Hanson
1996-11-26  0:00         ` Van Snyder
1996-11-22  0:00       ` Ken Garlington
1996-11-25  0:00         ` Robert Dewar
1996-11-21  0:00     ` Keith Thompson
1996-11-21  0:00       ` Robert Dewar
1996-11-22  0:00       ` Norman H. Cohen
1996-11-24  0:00       ` Lawrence Kirby
1996-11-21  0:00     ` Francois Labreque
1996-11-21  0:00       ` Kaz Kylheku
1996-11-24  0:00       ` Robert Dewar
1996-11-20  0:00   ` James Mansion
1996-11-20  0:00     ` Kaz Kylheku
1996-11-25  0:00   ` Joachim Durchholz
1996-11-26  0:00     ` Lawrence Kirby
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox