Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Borland Turbo C++ performance issue and tutorial errors Message-ID: <385@taumet.com> Date: 6 Aug 90 14:14:47 GMT References: <7921@tekgvs.LABS.TEK.COM> <380@taumet.com> <1894@tkou02.enet.dec.com> Organization: Taumetric Corporation, San Diego Lines: 32 diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: |In article <380@taumet.com> steve@taumet.com (Stephen Clamage) writes: |>There can be no validity to a claim that two programs written in two |>different programming languages are the "same"... |However, some machines can check SOME programs... |I am sure that you can verify, and you can write a program to verify, |that the following two programs (executed by processors conforming to |their respective standards; and using the ASCII standard character set |or, if you prefer, similar ISO version) are the same: |int main(int argc, char **argv) { PROGRAM junk(OUTPUT); | printf("Hello, world.\n"); BEGIN | return 0; WRITELN('Hello, world.'); |} END. The C program returns the zero status to whatever program invoked it. There is no such guarantee for the Pascal program. So these trivial toy programs might NOT be the "same" in their external characteristics, let alone what goes on internally! The orginal posting talked about a calculator program in C and in Modula. I believe that Modula follows Pascal-like rules about arithmetic exceptions, whereas there is no guarantee that any C system (ANSI included) will complain about, say, overflow or divide by zero. As to the null program, there might STILL be external differences due to what each language specifies about what must happen in its environment at startup and shutdown. -- Steve Clamage, TauMetric Corp, steve@taumet.com