caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: Raj Bandyopadhyay <rajb@rice.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Native code compile time question
Date: Fri, 05 Sep 2008 23:32:28 +0200	[thread overview]
Message-ID: <48C1A56C.4090401@starynkevitch.net> (raw)
In-Reply-To: <48C15DA2.6060800@rice.edu>

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: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


  reply	other threads:[~2008-09-05 21:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 16:26 Raj Bandyopadhyay
2008-09-05 21:32 ` Basile STARYNKEVITCH [this message]
2008-09-05 22:46   ` [Caml-list] " Jon Harrop
2008-09-05 22:44 ` Jon Harrop
2008-09-06 10:01 ` Richard Jones
2008-09-06 10:38 ` Christophe TROESTLER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C1A56C.4090401@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=rajb@rice.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).