Expression sequencing query

faustus at ucbcad.BERKELEY.EDU faustus at ucbcad.BERKELEY.EDU
Sat Oct 18 07:09:55 AEST 1986

In article <483 at jc3b21.UUCP>, fgd3 at jc3b21.UUCP writes:
>      Your examples support my point: a _portable_ language is one which
> runs identically on all implementations.  A language which permits the code
> generated by its statements to be implementation-dependent is not portable.

A language can't be called portable, but programs written in that language
can.  A measure of how useful a language is how easy it is to write portable
code in it.  By your definition, you could call any language "non-portable"
because you can always (at least if the language is used for real things)
write code that determines what kind of processor it is running on.

> When dealing with a non-portable language (like C) ...

I know of no other (useful) language which is as easy to write portable code
in as C.  Most other common languages such as lisp suffer from a lack of
a standard such as K&R which all compilers follow (at least in theory).  (I
know, there is a lisp standard now...)

> But if portability is important to you--and
> I believe it should be--then it is a flaw in the language definition to
> permit the evaluation of statements which are syntactically correct to
> depend on the implementation.

Most of these cases where things are implementation-dependent are situations
where the hardware must dictate how things are to be done if they are to be
done in an optimal manner.  For instance, order of argument evaluation must
depend on the implementation because different machines like different
stack setups.  Anyway, there is 'lint', so it should be very easy to write
portable C code if you try.


More information about the Comp.lang.c mailing list