[C2hs] precompiled headers with c2hs (again)

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Dec 13 22:18:06 EST 2004


All,

Just to let people know, we've progressed somewhat on the precompiled
headers front. Outwardly, the patch is much like Axel described
previously. Internally, we rewrote the serialisation using the Binary
module from GHC. This allowed us to use shared strings which reduces the
file size considerably (~20Mb to ~9Mb). It still uses a lazy reading
scheme so while producing the *.precomp file is still rather slow but
reading it is really quick.

For some reason (as yet undiscovered) the serialisation is very slow and
memory hungry. On my machine it takes 16 seconds to parse all of gtk/gtk
but 45 seconds to serialise all that to disk.

Our current branch is hosted in the gtk2hs cvs:
http://cvs.sourceforge.net/viewcvs.py/gtk2hs/gtk2hs/tools/c2hs/

It is based on c2hs 0.13.4. There are one or two interesting patches in
addition to the precompiled headers patch:

http://cvs.sourceforge.net/viewcvs.py/gtk2hs/gtk2hs/tools/c2hs/gen/GenBind.hs?r1=1.1&r2=1.2
This one makes c2hs chase typedef'ed types so that C function prototypes
that use typedef'ed types get propper Haskell types rather than Ptr ().

http://cvs.sourceforge.net/viewcvs.py/gtk2hs/gtk2hs/tools/c2hs/chs/CHS.hs?r1=1.1&r2=1.2
This one makes c2hs understand hierarchical module names.

Duncan



More information about the C2hs mailing list