From: peter@taronga.com (Peter da Silva)
Subject: Re: The need for an assembler (was: Favorite CPU)
Organization: Taronga Park BBS
Date: Mon, 7 Sep 1992 05:22:27 GMT

In article <1992Sep3.090347.21766@news.columbia.edu> lasner@watsun.cc.columbia.edu (Charles Lasner) writes:
>Your out-of-context quote doesn't change the point of the original: the O/S
>runs best on any hardware it was designed to run on; it isn't portable the
>way you would demand of it, so what?

It's not an application program. I'm not arguing against hacking at least
critical parts of operating systems to an inch of their lives, I'm arguing
against the incredibly widespread misuse of assembly in applications.

>>> Within the world of Kermit, we have frustrating cases of even small programs
>>> that need worlds of conditionals to satisfy the bizarre variations floating
>>> around the industry.

>>Within the world of Kermit the latest release I've tried still runs on Xenix-
>>286 (System III Xenix, not SCO), System V on the 386, System V on the 68000,
>>and on the Sparc. I would take some convincing that this would be possible
>>in any other language that's reasonably widely available, except maybe Fortran.

>So, why don't you thank the Kermit group for all of its frustrating work?

I have.

I've done the same sort of work, and it's a lot less painful than the
alternative: reimplementing the software from scratch several times over.
I'm the last person to claim that C is perfect. C is often too low level
for reasonable programmer efficiency, but the argument that writing portable
code is unreasonably painful or difficult or frustrating is garbage. You
need to learn how to write portable C, but once it's done it's NOT any
harder than writing non-portable C and porting it.

>The point still stands: C implementations are insidiously non-standard, and
>cause major maintainence problems when programs are *not* migrated, but
>rather are proliferated.

That depends on who wrote the programs, and whether they knew how to write
portable code. It's easier to write portable C than to write portable code
in any other language of the same general level (Pascal, Fortran, Modula 2,
and so on) that I know of, apart from toy languages that never get
implemented on unusual hardware.

I've written portable Fortran. The first thing you need to do is wrap the
entire I/O subsystem in a layer of application-specific routines. Pascal
*has* no usable I/O if you want a program that'll survive abuse. Modula 2
has no I/O in the language at all, and none of the "standard" libraries are
even vaguely similar.

>Before C existed, no one "ported" anything;

Go back 20 years and try "before Fortran existed, no one ported anything".
There are plenty of examples of common Fortran codes. Then came COBOL and
PL/1, all of which ran on multiple platforms and had standard versions.

C isn't the source of your problems, it's just the closest thing we have to
a reasonable solution. Your biggest problem isn't C, it's that you insist
on working in a highly unusual environment: the 80x86 family. And the problem
with CKermit's implementors is that they wrote a C program and ported it
instead of writing in portable C.

And even so, they succeeded. I don't think they would have in any other
reasonably widespread language.

>we merely had language specs and
>various levels of compatibility, hopefully of the kind of either it worked or
>the feature was lacking and you got error messages.  Now, the code may
>seem to be compiler error free yet not work,

You ever ported Fortran code? Obviously not.

>or needs to be allowed to
>get confusing warning messages from some compilers to actually function,
>because there's no reasonable way to eliminate the warnings all together

Gee, I *normally* eliminate warnings without "essentially having N copies
of the program with one woken up for each system type in much of the code".
-- 
                                                                `-_-'
                         Have you hugged your wolf today?        'U`

Peter da Silva, Taronga Park BBS, Houston, TX  +1 713 568 0480/1032
Xref: sparky alt.folklore.computers:14016 comp.unix.misc:3688