[comp.lang.misc] Languages for machine-dependent hacks

cik@l.cc.purdue.edu (Herman Rubin) (11/06/90)

In article <1990Nov1.082214.15859@tkou02.enet.dec.com>, diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
> In article <1849@exodus.Eng.Sun.COM> chased@rbbb.Eng.Sun.COM (David Chase) writes:
> >diamond@tkou02.enet.dec.com (diamond@tkovoa) writes:
> >>C was invented in order to be that better assembler.  If you want machine
> >>level, you're supposed to program in C.  That is exactly the purpose for
> >>which C was created.  If you want an HLL, use one; don't cripple C.
> >This may be true for (one dialect of) pre-ANSI C,
> For the original and several revisions; for its entire raison d'etre.
			
			.........................

> It is now necessary to invent a new language for machine-dependent
> hacks, in order to do what C was supposed to do, or else -- as was
> stated by the poster that I previously followed up to -- return to
> the days of assembly language programming instead of using a moderately
> portable syntax.  C used to beat assembly in many cases.  Now C is
> no longer in the running.  What a shame.

This MAY have been the intention, but if so, it never came close.

As a simple test, try unpacking a double floating number on the
VAX into its exponent and mantissa in such a way that the resulting
mantissa can be used for integer arithmetic sensibly, and also
reversing that operation.  Now do it keeping everything in registers.

Even single precision is  hard enough.

Even try doing multiple precision ADDITION of long integers, using
condition-code carries.

These are not just criticisms of C, but of every other language I
have seen.  These are not outrageous operations, either.  I have
seen, and used, other operations natural to the problem, and at
least on some machines easily handled by the hardware, which seem
quite foreign to the languages.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet)   {purdue,pur-ee}!l.cc!hrubin(UUCP)