Re: Assembly verses a high-level language.

Graham Matthews <Graham.Matthews@pell.anu.edu.au>
Wed, 29 Nov 1995 23:26:39 GMT

          From comp.compilers

Related articles
Assembly verses a high-level language. tomviper@ix.netcom.com (1995-11-20)
Re: Assembly verses a high-level language. macrakis@osf.org (1995-11-22)
Re: Assembly verses a high-level language. bobduff@world.std.com (1995-11-28)
Re: Assembly verses a high-level language. marcus@illusion.magicno.com (1995-11-29)
Re: Assembly verses a high-level language. Graham.Matthews@pell.anu.edu.au (Graham Matthews) (1995-11-29)
Re: Assembly verses a high-level language. john_reiser@MENTORG.COM (1995-12-09)
Re: Assembly verses a high-level language. albaugh@agames.com (1995-12-09)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Graham Matthews <Graham.Matthews@pell.anu.edu.au>
Keywords: assembler, performance
Organization: School of Mathematical Sciences, ANU, Australia
References: 95-11-166
Date: Wed, 29 Nov 1995 23:26:39 GMT

Tom Powell wrote:
> How come programs written in assembly are so much faster than any
> other high-level language. I know that it is a low-level language and
> that it "speaks" directly to the hardware so it is faster, but why
> can't high-level languages compile programs just as fast as assembly
> programs?


There are two answers to this. The first answer is that compilers can
and do produce better code than humans do. This may not be true in
the PC world (PC as in "personal computer", not as in IBM ...), but
its' certainly true in the Unix and supercomputer world for languages
like C and Fortran. Why PC compilers are not so hot I don't know.
Probably something to do with market demands.


The second answer is that high level languages often include
convenient but expensive constructs that are not in assembly
language, and that if you were to program in assembly language would
be just as slow as in the high level language. Functional closures
comes to mind. OO dispatch is another.


graham
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.