POV-Ray : Newsgroups : povray.unofficial.patches : megapov bug : Portability (was: megapov bug) Server Time
1 Sep 2024 22:18:02 EDT (-0400)
  Portability (was: megapov bug)  
From: Peter J  Holzer
Date: 17 Feb 2001 12:01:40
Message: <slrn98t8ig.9hi.hjp-usenet@teal.h.hjp.at>
On 2001-02-16 14:34, Warp <war### [at] tagpovrayorg> wrote:
>Thorsten Froehlich <tho### [at] trfde> wrote:
>: Yes, my local STL is really fast, too, but what is all the speed good
>: for if it is still not portable?
>
>  It's an interesting question whether a 100% standard compliant code
>can be considered portable or not.
>  If the code is completely standard, it's not the code's fault that a
>compiler can't compile it. I don't think that you can say that the code
>is not portable, since the code is 100% standard.

I do think so. "Portable" does not mean the same thing as "standard
compliant". It means "compiles and runs with the expected result on a
wide variety of platforms". Since I'm not familiar with C++, I'll use C
as an example:

The C standard was finalized in 1989, about 15 years after the language
was invented and about 10 years after K&R was published.

Does that mean that one could not write portable C programs until 1989,
because there was no standard? Absolutely not. There were a lot of
programs, which worked on PCs, Unixes, VMS, mainframes, etc. They were,
in every sense of the word, portable.

OTOH, If, in 1990, you wrote a program with the C standard as your only
reference, would that program be portable? Probably not. The C standard
did not only define a common subset of all existing C implementations
(although that was its primary goal), but it also standardized some
things which were only implemented by a few implementations or even
other languages, but seemed generally useful, and some things were even
invented out of the blue. So a program, which used for example,
prototypes, <stdarg.h>, locales, and some macro features would have a
very slim chance to compile on a randomly chosen platform. It was not
portable. OTOH, a lot of not standards-compliant programs (because they
used <varargs.h> or sockets, or relied on two's-complement arithmetic)
were very portable, because those features they relied upon were in
widespread use.

For C, which is a rather small standard IMHO, it took about 5 years
after the standard was published, before you could expect the large
majority of installed compilers to handle most of the C standard
correctly. Until that time a portable program had to work around the
flaws and deficiencies of various compilers.

You can debate whether this is the fault of the standard writers,
because they standardized things which didn't exist, or the compiler
writers, because they were not fast enough in providing
standard-compliant compilers, or of the customers, because they didn't
upgrade their compilers as soon as they were available, but that was the
situation with C in the early 1990s.

I expect the situation will be similar for C++.

	hp

-- 
   _  | Peter J. Holzer    | All Linux applications run on Solaris,
|_|_) | Sysadmin WSR       | which is our implementation of Linux.
| |   | hjp### [at] wsracat      | 
__/   | http://www.hjp.at/ |	-- Scott McNealy, Dec. 2000


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.