From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pB99wwXC004633 for ; Fri, 9 Dec 2011 10:58:58 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUBAF7b4U5KfVI0imdsb2JhbABDmjuQJggiAQEBCgkNBxIGIYFyAQEBAwEBAg8CLAEbDwMGBQEDAQsGBQsNDSEiAQUMAQUBChIGExIICIdlCJoFCotkgmuERj2IcQIFDINsh3oEkkuCJY1xPYN6 X-IronPort-AV: E=Sophos;i="4.71,325,1320620400"; d="scan'208";a="134689672" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 09 Dec 2011 10:58:53 +0100 Received: by wgbdr12 with SMTP id dr12so6347023wgb.9 for ; Fri, 09 Dec 2011 01:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=9KYEBI+ioXx39ZkLfDMCpRVZP1ApBRSM3hWKGEjI6Xs=; b=OzymE//f2nntVqEwOMIMzU32VU+Ln7u5/uF4XndC/zJ2MRAkp1YW3zG2QUBzm0mrjN TDh3iE4IFllfI43JP0K02nHD6n1014jZD+Db47VJDrNj+n9dJIxklCQQFT25RuNgICtG +FsEH0x0/rpqYdLskLzYGCSZbm1ojljMSsyow= Received: by 10.216.174.74 with SMTP id w52mr457314wel.11.1323424733239; Fri, 09 Dec 2011 01:58:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.43.4 with HTTP; Fri, 9 Dec 2011 01:58:31 -0800 (PST) In-Reply-To: <4EE1BE59.4020804@glondu.net> References: <20111209065758.94306.qmail@eeoth.pair.com> <4EE1BE59.4020804@glondu.net> From: Gabriel Scherer Date: Fri, 9 Dec 2011 10:58:31 +0100 Message-ID: To: =?ISO-8859-1?Q?St=E9phane_Glondu?= Cc: oleg@okmij.org, caml-list@inria.fr, ontologiae@gmail.com, caml@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id pB99wwXC004633 Subject: Re: [Caml-list] Why NOT to compile OCaml via C > I find the idea of making ocamlopt a GCC (or > LLVM) frontend the most sensible and constructive one I've seen in these > discussions. Note that, besides Oleg excellent description of some issues, the idea has already been discussed a few times before, here and on llvm-dev: - http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-November/011525.html (discussion on llvm-dev) - http://caml.inria.fr/pub/ml-archives/caml-list/2010/11/315de2fb3656166edba13bb657fa691f.fr.html (Benedikt Meurer: why ocamljit2 isn't an LLVM backend) - https://sympa-roc.inria.fr/wws/arc/caml-list/2011-08/msg00192.html (Pierre-Alexandre Voyes: question about a C backend; further discussion of the DDC case) - https://sympa-roc.inria.fr/wws/arc/caml-list/2011-08/msg00003.html (Wojciech Meyer: announcement of an ocaml compiler framework project with goal and structure similar to LLVM) I found back some of this links thanks to the excellent "OCaml Weekly News" summary: http://alan.petitepomme.net/cwn/2011.08.02.html (Where Benedikt announces that he has a student working on an LLVM backend.) OCamlPro also published an internship offer for an LLVM backend. Apparently, there was at the time no particular interest among the existing OCaml compiler hackers to develop such a C, LLVM or what you have backend. Lots of people are talking about it, but few actual work is done, or at least publicly exposed. I guess everyone would be happy to look at an good LLVM backend, *especially* it is complete, stable, safe enough to be a potential candidate for integration (if the work needed between the working prototype and an integration is huge and nobody is interested in doing it, it will remain at a prototypical stage) but I will believe it when I see it. I'm confident both Benedikt and/or OcamlPro (or other parties that I don't know) would have the expertise to do something very good in this direction, and I hope they'll go forward with this. It's just that I don't feed the need for another bunch of emails about how LLVM passes are great, GC issues, JIT or not JIT, performances of the current Javascript engines, how frustratring it is that emacs is as slow to start today as it was ten years ago, and the good and bad of Python's meaningful-indentation syntax. > However, one barrier is the licensing: QPL is incompatible with almost > any license (even QT does no longer use it!). Has it ever been > considered to switch the "public" license to e.g. GPLv3 (which looks > constraining enough, and compatible with GCC)? Stéphane, I am surprised at how good your are at raising trollish topics ! I don't think now is a good time to discuss this; maybe we should wait for dust to settle on the other trolls before restarting a "discussion" (where everyone agrees, but BSD or GPL?) on this. On Fri, Dec 9, 2011 at 8:52 AM, Stéphane Glondu wrote: > Le 09/12/2011 07:57, oleg@okmij.org a écrit : >> There are at least two other reasons ocamlopt emitting assembly. One >> is garbage collection. OCaml GC is precise. Therefore, when sweeping >> through the stack, GC has to know if 0x80aa4000 is an unboxed integer >> or a heap pointer. So-called frame tables generated by the compiler >> tell GC which stack slots contain OCaml values. GC ignores other slots >> and hence expensive tests it had to do otherwise. One can build frame >> tables only when one has full control of the generated code and the >> frame layout. The third reason is exceptions. In OCaml, exceptions are >> pervasive and should be fast. They are indeed well implemented, via >> special exception frames and a dedicated exception frame `register' >> (which is a real register on x64). > > C sure is not a good target language, but assembly is not either. > The assembly backends of ocamlopt (and GHC... there is no support at all > on some Debian ports) look like a maintenance burden that their authors > obviously cannot cope with. I find the idea of making ocamlopt a GCC (or > LLVM) frontend the most sensible and constructive one I've seen in these > discussions. > > However, one barrier is the licensing: QPL is incompatible with almost > any license (even QT does no longer use it!). Has it ever been > considered to switch the "public" license to e.g. GPLv3 (which looks > constraining enough, and compatible with GCC)? > > > Cheers, > > -- > Stéphane > > > > -- > 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 >