Pierre-Alexandre Voye wrote: > I have a stupid question : I wonder if it would not be a bad idea that Ocaml > output C code and let gcc do its work, so compile code with good > performances in a lot of architecture ? Gcc is able to do autovectorization > (SSE, MMX, Larabee in the futur, etc...), very specific processor > optimization, etc... > But maybe it's a stupid idea ?
I have some experience in thie area. I work on the DDC compiler [0] a compiler for a strict by default (optionally lazy) evaluation dialect of Haskell. When I joined the project the compiler had a working compile via C backend, to which I added an LLVM backend [1]. Executables compiled via the LLVM backend (even without exploring any of the LLVM optimisation passes) were faster than the same executables compiled via C (gcc -O2). I suspect this is because the generated C code was nothing like the C code people write and the GCC is only good at optimising idiomatic C code. I highly recommend LLVM as a compiler backend. HTH, Erik [0] http://disciple.ouroborus.net/ [1] http://www.mega-nerd.com/erikd/Blog/CodeHacking/DDC/index.html -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
