Machine-independent intermediate languages

Guy Harris guy at auspex.UUCP
Sat Oct 29 09:36:24 AEST 1988


>Both languages' inventors created them expressly to be assemblers with
>a portable syntax.  ...
>
>The phrase "portable assembler" is unfortunately ambiguous.  This has
>led users to expect C PROGRAMS to be as portable as the language's
>SYNTAX.

You mean users like Dennis Ritchie, Steve Johnson, etc.?  Those foolish
people; had they known that C programs were really assembler-language
programs, they would never have tried to make them work on multiple
machines....

To quote from Johnson's "C Program Portability":

	  As soon as C compilers were available on other machines, a
	number of programs, some of thm quite substantial, were moved
	from UNIX to the new environments.  In general, we were quite
	pleased with the ease with which programs could be transferred
	between machines.

It goes on to say that the difficulties they ran into in porting were:

	1) As the language evolved, compilers changed so there were
	   incompatibilities between the compilers due to features
	   that had made it into one compiler but not into another yet.

	2) The machines ran different operating systems.

The latter was described as the most serious difficulty, and led them to
note "gee, UNIX is written in C, how about porting *it* to other
machines" - a decision whose ramifications most of us can testify to....

>Since their demands have been listened to, C is losing its
>original capabilities.

For example?

>Anyone who wants to write portable PROGRAMS should use another language.

You may believe this, but there are a vast number of people whose
experience indicates that it is simply not true.  Given that, you may
want to re-evaluate your belief....  (Remember, BTW, that "is-portable" is
not a Boolean predicate; not all programs may be portable to completely
arbitrary architectures, although the range of architectures that
support C and UNIX is fairly impressive.)



More information about the Comp.lang.c mailing list