From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 58D01BBAF for ; Fri, 5 Sep 2008 23:32:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4PALhBwUg+BBB3Smdsb2JhbACBZZBIAQEbHKQEgWWDMQ X-IronPort-AV: E=Sophos;i="4.32,342,1217800800"; d="scan'208";a="16887249" Received: from smtp-119-friday.nerim.net (HELO maiev.nerim.net) ([62.4.16.119]) by mail1-smtp-roc.national.inria.fr with ESMTP; 05 Sep 2008 23:32:36 +0200 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by maiev.nerim.net (Postfix) with ESMTP id 4FFE9B8312; Fri, 5 Sep 2008 23:32:35 +0200 (CEST) Received: from glinka.lesours ([192.168.0.1] ident=basile) by hector.lesours with esmtp (Exim 4.63) (envelope-from ) id 1Kbisj-0002Xq-I3; Fri, 05 Sep 2008 23:30:17 +0200 Message-ID: <48C1A56C.4090401@starynkevitch.net> Date: Fri, 05 Sep 2008 23:32:28 +0200 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Raj Bandyopadhyay Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Native code compile time question References: <48C15DA2.6060800@rice.edu> In-Reply-To: <48C15DA2.6060800@rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; basile:01 basile:01 ocaml:01 ocaml:01 compiler:01 compiler:01 bytecode:01 c--:01 faiencerie:01 92340:01 reine:01 wrote:01 compile:01 compile:01 caml-list:01 Raj Bandyopadhyay wrote: > Hi all > > I am implementing a language by generating OCaml code for input source > and using the OCaml native code compiler. However, I've run into a > strange problem. > > On using my code generator on a large program, I generate a file containing about 75K lines of OCaml. > The native code compiler takes more than 30 *minutes* to compile this file! The bytecode compiler takes about 5 secs. It depends of your langage and of the code you are generating, but maybe Ocaml is not the right tool for that. Did you consider stuff like LLVM http://llvm.org/ or C-- http://cminusminus.org/ both designed to be languages to be generated by a program (not to be coded in by a human)? It could also be that you are generating huge functions. Avoid generating huge functions (and you'll get the same kind of troubles if you generate huge C functions). All the low level code generation issues and algorithms (e.g. instruction scheduling, register allocation) are violently non linear. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***