On Thu, Jan 24, 2008 at 02:43:13PM +0100, Stephane Glondu wrote: >> Ideally, everything should be linkable dynamically and that should be >> done per default; then, if one really wants, it should be possible to >> statically link, but I would like to see this possibility both for >> native and bytecode world. > > I was just trying to give an analogy with C to justify the locations of > the files. I did not understand what you mean after "Ideally...". Let me try to re-express myself. I mean that one of the current major deficiency of OCaml is that is does not dynamically link objects at link time, but rather statically links them. At the moment you can use dynamic *loading* in your applications, but this is only for bytecode objects and only with the explicit willingness of the programmer. In an ideal scenario, OCaml would work precisely as it does now for the programmer, but store in the finally linked executables and libraries only references to objects that will then be loaded dynamically at runtime. If that were true, than your analogy with C would stand. Also, still in the ideal scenario, that would be possible both for nativecode and for bytecode, and, when explicitly asked for, it would be possible to statically link, obtaining back the current (non-ideal) behaviour. ---- After this discussion I have been looking at the forthcoming plans for OCaml (sources: Xavier's slides at the OCaml community meeting) and it does indeed mention dynamic loading of nativecode objects. However, my understanding of the feature is that you will have a module that the programmer have to invoke explicitly to dynamic load, as it currently happens with bytecode. This, IMO, is totally unlikely to change the default deployment strategy of OCaml application, which will remain static linking. So we should decide what to do keeping in mind the *possibility* of dynamic loading of native code, but not considering dynamic loading as the default for every application, because it won't be the case. YMMV. Cheers. -- Stefano Zacchiroli -*- PhD in Computer Science ............... now what? zack@{upsilon.cc,cs.unibo.it,debian.org} -<%>- http://upsilon.cc/zack/ (15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the (15:57:15) Bac: no, la demo scema \/ right keys at the right time
Attachment:
signature.asc
Description: Digital signature