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.