On 22 November 2008 01:20 Jon Harrop wrote:
> On Friday 21 November 2008 23:45:34 Dario Teixeira wrote:
> > Hi,
> >
> > > Does ocamlfind support any of this?  Since I'm now also
> > > cross-compiling OCaml, I've certainly come to appreciate
> > > findlib more than ever.
> >
> > Indeed it does.  The current version of Ocsigen already
> > makes use of this feature.  However, because very few
> > (none, actually, other than Ocsigen's) packages currently
> > ship with cmxs files, an Ocsigen user who wants to play
> > with native code is forced to manually generate them.
> > (What impelled me to write the request was precisely
> > having just gone through the process of producing the
> > cmxs for a bunch of Ocamlnet and PXP libraries...)
> 
> This begs the question: what is the advantage of a .cmxa over a .cmxs,
> and
> what are the downsides of linking everything dynamically?

That's reducible to the standard debate of static vs dynamic linking in any 
language, surely? The only "impact" on performance presumably is the re-writing 
of the symbol tables which flexlink/dlopen does as the .cmxs file is loaded but 
that must be negligible. However, isn't ocamlopt able to do some cross-module 
optimisation (which is why .cmx files are usually shipped as well as .cmxa) - 
this presumably isn't possible when linking dynamically...

Short-term, native dynlink doesn't work on all platforms (AFAIK?) so .cmxa is 
not dead, whatever your linking preference.


David

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to