At 04.06 -0700 0-09-11, Simon Marlow wrote:
>> But why cannot the stuff in a .hc file be directly compiled with any
>> C-compiler into a binary format, and executed directly? Does
>> it have to do
>> with some special kind of needed file merging?
>
>It can be compiled without any munging, but you lose many of the
>optimisations (about a factor of 2 slowdown and increased binary size).
>However, the ability to compile with just a copy of gcc is useful for
>porting.

OK, fine. So if one skips the munging, and GHC itself is written in
portable C, there should not be a problem of porting it.

>From what you say, it looks as though one isn't forced using GCC, then one
should be able to compare speed against code produced by other compilers.
The thing is that compilers start to become so clever in doing
optimizations, so one may wonder if there is any point in GHC having such a
feature:

If it's only a factor two, that is how much computers increase in speed in
about a year or so. So it may take longer for you to implement the munging
feature than simply waiting out the next computer model. :-)

Similarly, code size use to not be a problem with computers anymore, PC and
up, in general application: My sister just bought a typical home computer,
and it has 128 MB RAM and a 20 GB hard disk. Wouldn't that be enough for
both GHC and the code it produces? And then knock onto a factor two on this
for every year it takes for you to develop GHI. By time the project is
finished, there wouldn't be a problem, one would think.

  Hans Aberg



Reply via email to