On 12/08/2011 01:11 PM, Pierre-Alexandre Voye wrote: > 2011/12/8 Benedikt Meurer <[email protected]> > >> >> >> >> The problem is IMHO that there is no one at INRIA caring about ARM. In an >> open model we would have maintainers for the ARM port(s). >> > Note that if Ocaml compiler would have a C backend, all these problems or > architecture port would disappear... > Ocaml would have more than 30 target[1] > In my Opinion, trying to generate assembler is a bad idea because modern > CPU require a lot of work to generate good assembler. > Only the GCC and LLVM team are big enough to be able to make a good job. > > In the Lisaac project, we were able to compete with C[2]. Lisaac is a > compiler for a Smalltalk like language : the if/then/else is unknown to the > compiler, it is defined in the true/false object. So it is a proof that a > very high level language can reach C performance. Ocaml can do this, > because the compiler is able to know a lot of type informations. > The Lisaac compiler use strong flow analysis and, more importantly generate > C code. To reach performance, Lisaac tailor C code to help GCC to generate > very optimized code.
Wouldn't it be more reliable to write a GCC OCaml frontend, or an LLVM OCaml frontend? (or generate GCC Gimple, or LLVM IR). I think GCC already has a frontend which is written in the language itself (Ada). There are things that cannot be easily expressed in C, such as tail calls, type hierarchies, etc. Also there is a lot of undefined behaviour in C that you can quite easily hit, especially if you automatically generate code. Best regards, --Edwin -- 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
