[Haskell-cafe] Non-technical Haskell question

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Mon Dec 6 09:00:05 EST 2004

> >  When I compile it I get three files, an actual runnable binary (at only
> > 5M in size), a .o file and a .hi file. I'm sure these additional files
> > are usefull in someway and as soon as I come across the right piece of
> > documentation everything should make sense. But as a person new to the
> > language I'm just left wondering why.

gcc of course leaves .o files lying around, so this is no different than C.

javac often creates tens or hundreds of .class files, some with
strange names like MyClass$1.class, MyClass$2.class, and so on (yes, I
know what they are for), and doesn't even generate a native binary.

I don't think the output of ghc is any more surprising than these; I'm
surprised it bothers you.

The static vs dynamic linking question has been discussed many times.
The summary is: GHC is a highly-optimising compiler, and the binary
interface _necessarily_ changes with every minor revision (even
patchlevel revision) of the compiler and each library.  So you can't
sensibly share libraries between apps.  Anyway, disc is cheap.


--KW 8-)

More information about the Haskell-Cafe mailing list