A Faster Language? (Was Re: Prolog is "faster" than C)
Charles Hannum
hannum at haydn.psu.edu
Sun Jul 1 15:25:01 AEST 1990
In article <2134 at polari.UUCP> 6sigma2 at polari.UUCP (Brian Matthews) writes:
Of course. I think there would be little argument that for any application,
the optimal speed of that application will be achieved by carefully hand
coding it in assembly language. But how much production software is
written in assembly language these days?
No, definitely not much argument about the point. But to answer your question,
there is a CAD program for the PC called FastCAD that's written in 8086
assembly language, and I'm told (though I don't know positively) that the
entire VM/CMS operating system (which sucks, but that's beside the point) that
IBM uses on their mainframes is written in /370 assembler.
I don't know how much other software is written in assembly language, but
obviously somebody has an interest in speed ...
Anyway, the way /370 assembly language is coded, it's fairly easy to write
modular, working programs, which I can't say for any other assembly language
I've ever written (including 80([123]?8[67]|48|[35]1), 6809, 6502, and VAX,
just in case you're wondering). (BTW: I group the Intel chips in one regular
expression because I feel they're all on the same level ... B-I)
If all assembly language was as clean as /370, you would probably see a lot
more production code written in assembler. (This is not to say that /370 is
perfect and doesn't have problems.)
But to treat your point seriously, yes, I presonally have written production
code in assembly language, mostly for the PC, because compiled C code has a
tremendous amount of extra code (read: library routines) added to it, and is,
as mentioned, slower than the assembly language version.
On Unix machines, I don't worry so much about size, but speed is always a
consideration.
On another note: I've found that, with a good optimizing compiler like gcc,
on the whole the assembly/C speed difference is overall much less than the
difference one gains by finding a better algorithm. I could go into some
horrible details and statistics from my own experience to demonstrate this, but
I'll spare you. It's not worth the effort it would take to dig up all the
information...
--
Virtually,
Charles Martin Hannum "Those who say a thing cannot be done should
Please send mail to: under no circumstances stand in the way of
hannum at schubert.psu.edu he who is doing it." - a misquote
More information about the Comp.lang.c
mailing list