From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DC2CF820A1 for ; Fri, 6 Sep 2013 15:56:13 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.90,854,1371074400"; d="scan'208";a="31800757" Received: from dhcp-rocq-250.inria.fr (HELO [128.93.62.250]) ([128.93.62.250]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 06 Sep 2013 15:56:13 +0200 Message-ID: <5229DEF9.7040706@inria.fr> Date: Fri, 06 Sep 2013 15:56:09 +0200 From: Romain Bardou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: "caml-list@inria.fr" X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Validation-by: romain.bardou@inria.fr Subject: [Caml-list] Accelerating compilation Hello list, As my project grows bigger, it is becoming much less efficient to use the type-checker to quickly find places in my code which must be updated (e.g. pattern-matching). Here is a wishlist for improvements. 1) Separate typing and code generation, in ocamlc and in ocamlopt For instance, provide an option -typing-only which would mean "only produce the .cmi but do not produce the .cmo or the .cmx". The compiler would only need the .cmi of the dependencies, not their .cmo or .cmx. This would make it possible to have a Makefile target, or an Ocamlbuild option, to just type. Also, provide an option -do-not-retype which would mean "if the .cmi exists, load it instead of type-checking again". This would allow the build process to first type-check (using -typing-only) and then generate the code without type-checking again (using -do-not-retype). Of course the build system should be very careful to ensure the .cmi is up-to-date. This option could also help when compiling both in bytecode and in native code. This option is not necessary to just find errors quickly, though. 2) Be able to disable Ocamlbuild's digest mechanism and use dates and file sizes instead If I am not mistaken, this is one of the main reasons why Ocamlbuild is slower that make. It does help to prevent useless recompilation, but what good does it make to prevent a useless recompilation once in a while if it is at the cost of losing a lot of time in all other cases? I'm sure it is project-dependent though so it should only be an option, say, -do-not-hash, or -comparison-mode dateandsize. 3) Parallel compilation in Ocamlbuild Of course it would help but it is not easy to implement so I'm just putting it there to be exhaustive. I think the most important point is the first one, as the other two depend on the build system, and they have been debated already. I'm not aware of any discussion about separing typing and code generation though. What do you think about that? Cheers, -- Romain Bardou