Joel Reymont writes: > On Mar 21, 2009, at 1:38 PM, Jon Harrop wrote: > >> . You will succumb to ocamlopt's current run-time representation >> which is >> objectively inefficient (e.g. boxing floats, tuples, records) and >> was only >> chosen because the compiler lacks capabilities that LLVM already >> provides for >> you (primarily JIT compilation). > > This is probably a stupid suggestion but why not have OCaml directly > generate machine code, without the use of assembler and linker? Because that would duplicate the code and logic provided by the system's assembler and linker (esp. linker). For every platform (and there are many possible combinations!). If you use the existing linker, then you can depend on the expertise of the authors for each system getting all the logic right for loading libraries (which may be arbitrary libraries, when you're using C extensions) and producing a binary in the correct format for that system. Something like LLVM means that OCaml doesn't even need to duplicate the knowledge about how to generate code for each architecture -- the compiler author can focus on writing a really good front end, and the LLVM people can focus on making an excellent machine code generator. If compilers can attract the best front-end authors, and projects like LLVM attract people with the best grasp of optimization and other back-end matters, then the entire compiler ecosystem benefits more than if these experts are split amongst many compiler projects. - Michael -- mouse, n: A device for pointing at the xterm in which you want to type. Confused by the strange files? I cryptographically sign my messages. For more information see .