On Aug 17, 2008, at 7:54 PM, André Pang wrote:
> It's certainly not dead
In that case,
I've figured out the build problem with using the system libffi. I'll
commit a patch for that as soon as possible.
I've also figured out all the build problems dynamic libraries. It
turns out that mac os x is one of the few platforms that building PIC
code and -dynamic works at all. Unfortunately, none of the cabal
libraries (or the ghc libraries) are built as shared libraries. This
means that your dynamic version of HOC needs to staticly link in all
it's dependencies. If your main app also links those dependencies,
this creates two copies of that dependency in memory. It's possible
to build GHC and cabal stuff with all dynamic libraries (which will
solve this problem) but the link command isn't generated by GHC and so
must be determined by hand (or generated from the data in ghc-pkg),
and more importantly, isn't supported by the cabal or GHC build
system very well.
I don't see any good reason to build HOC as a dynamic library, since
without jumping through very small, very high loops, it's entirely
possible it will increase your memory usage, thus negating the
benefits of a shared library.
The best answer is that dynamic library support is very close to ready
in GHC 6.10 (and is targeted for 6.10.1 currently). GHC 6.10 is
supposed to be out in a few weeks, so we should revisit dynamic
libraries then.
There are a few other issues.
- HOC installs itself in an odd place with current versions of GHC.
- I'm unfamiliar with the cabal build system so I haven't touched that
stuff at all. Are there plans to maintain two build systems
indefinitely?
- Mac OS 10.5 introduced xml descriptions useful for generating
language bindings for all of their core frameworks. It's entirely
possible this could simplify the code generation.
- Mac OS 10.5 introduced garbage collection into Objective-C. This
might simplify the referencing managing code.
- Mac OS 10.5 also deprecated a whole bunch of objective c runtime calls
- make happily continues on errors, even with -k. This should
probably be fixed.
Now that I have a google code account, I'll try to add these issues in
the issue tracker.
Right now I'm trying to understand the code that is there and adding
comments as I figure it out.
--
Daniel
|