P
P.J. Plauger
Thats nice, but not the question OP was asking. Please crack open a
dictionary: Availability != Portability.
No, but it's part of a complete breakfast. Portability is a
measure of the relative cost of moving software between
platforms vs. rewriting it; it's not a Boolean. Availability
is thus an important factor in improving portability.
[...] and many of them score nearly perfect on two or more
nontrivial validation suites. Put another way, I've sold C code
intended to be portable also for several decades and I've *never*
had to worry about whether that code will compile, and execute
correctly, on a multitude of platforms. (With C++, I *always*
worry.)
Before C came along, I was doing similar things with Fortran,
and with reasonable success.
Well yeah, and you could do the same thing with Visual Basic, and the
various Basic interpretors available for UNIXs, and so on.
Please don't translate my qualitative measure into a Boolean.
Turn your contrast knob down a bit. My point was that you could
achieve rather high portability using the Pfort subset of Fortran.
(See Kernighan & Plauger, "Software Tools".) You could do not
quite as well with Pascal, even though that language was allegedly
more portable than Fortran. (See Kernighan & Plauger, "Software
Tools in Pascal".) But you can write *way* more powerful code
that's portable in C.
If you push
the entire job of portability up to the actual developer of the code,
well then in fact *MOST* languages are portable.
Your contrast knob is set too high again. The developer always
has *some* responsibility in writing portable code; the question
is what reward you get for your effort. I maintain that Standard
C has a pretty high reward for remarkably low effort, particularly
given that C is such a powerful (read: low level) language. But
it's never a question of putting all the responsibility either
on the programmer or on the language. So to say that most
languages are portable is to once again treat portability as a
Boolean, when it's not.
If fact, did you know
its fact possible to be portable *BETWEEN* many languages? When you
put the onus onto the programmer, you can claim all sorts of
capabilities for your language.
No, you can claim all sorts of capabilities for the programmer.
But if you're rewriting the code, you've left the above
definition of portability in the dust.
There is a subtle difference between a language begin portable, and
software which has been painstakingly ported.
Only if you think in black and white. We informally say that
a language is portable if it lowers the cost of writing
programs that are portable (cheaper to move than to completely
rewrite). If you take too much pain in porting the code,
somewhere along the line the cost of a complete rewrite
proves to be lower and the code is "not portable". (You
sometimes find that out too late.)
[...] And I've used about half a dozen
other popular languages with lesser success. So, IM(extensive)E
C portability is far from meaningless to me. YM(obviously)V.
In c.l.c we often see 'not portable' comments, but I wonder just how
portable C apps really are.
They're not. Amongst languages in common use today, C is just like
Visual Basic in that there just really isn't any real expectation of
portability on any real world application code. Nearly every other
language in common use today is far more portable than C.
Does your planet have an oxygen atomsphere? Just curious.
Well my planet has Lua, Java, Python, Perl, TCL, and bizarre new
languages like Haskel, Scheme, etc. They are all portable.
I wonder what language their compilers were written in. I'm
sure *some* of them were written in languages other than C.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com