From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 0BDE5BC57 for ; Mon, 13 Dec 2010 00:41:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0AAN/mBE1KfVK2kGdsb2JhbACXBIx5CBUBAQIJCQwHEQQlp2GMCAEFjHABBIVK X-IronPort-AV: E=Sophos;i="4.59,333,1288566000"; d="scan'208";a="92070877" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail1-smtp-roc.national.inria.fr with ESMTP; 13 Dec 2010 00:41:27 +0100 Received: by wyf19 with SMTP id 19so5539509wyf.27 for ; Sun, 12 Dec 2010 15:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=D0oun1K2g9p0BoXt4EDPaZrveVow1MGnhiMPJrJFKE4=; b=EGJkRpov8y0ATdxeOSlbOTiOy3MpJypBRdJu5G7IKlkOOZ5505JtIU+Yp02v7tL3TT vRpif/kZlZ+sFrhYsqa2FY4DaYDpK4QS6s9Xqqtpax1iXPc77Vo2J8lQZgwNmNMNgA1m VV3fHmq67T/N4UTpGnL577FH39h1PZiAxLvkM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:organization :message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:content-language; b=BCZdZm0gCfNU4QMFN3Jvm2wKTwg2AhMlnRO8MXoqWJ3n+is/zT66S5EHZg6eVONfP4 fWt5pMGzeZn0wooKAaztgGOVidSn0gGvQVaVtmIlWOc4DqVs8q+TS0bbc4EVzdtZUvTB K/kXF58AhIweN2nx+jrL/sKaiK3rwKeQBnlOI= Received: by 10.216.143.2 with SMTP id k2mr423535wej.66.1292197287457; Sun, 12 Dec 2010 15:41:27 -0800 (PST) Received: from WinEight ([84.93.149.66]) by mx.google.com with ESMTPS id b30sm930432wen.25.2010.12.12.15.41.25 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Dec 2010 15:41:26 -0800 (PST) From: Jon Harrop To: =?iso-8859-1?Q?'T=F6r=F6k_Edwin'?= Cc: References: <036001cb9a0c$725acef0$57106cd0$@com> <20101212175524.73a8e285@deb0> <9264BEE6-DBAE-4523-93AC-4560615D2AC5@googlemail.com> <20101212215552.317892e7@deb0> <03a701cb9a48$b957e860$2c07b920$@com> <20101213002724.3ef32c01@deb0> In-Reply-To: <20101213002724.3ef32c01@deb0> Subject: RE: Value types (Was: [Caml-list] ocamlopt LLVM support) Date: Sun, 12 Dec 2010 23:41:15 -0000 Organization: Flying Frog Consultancy Message-ID: <03b201cb9a56$122c7700$36856500$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuaS8R9iBlix/y/R/OSyHV0sCGAcQABnx1g Content-Language: en-gb X-Spam: no; 0.00; ocamlopt:01 afaict:01 ocaml:01 bindings:01 ocaml:01 fwiw:01 bindings:01 stubs:01 cheers:01 edwin:98 edwin:98 imho:01 wrote:01 wrote:01 caml-list:01 Edwin wrote: > On Sun, 12 Dec 2010 22:05:34 -0000 > Jon Harrop wrote: > > Edwin wrote: > > > AFAICT LLVM's OCaml bindings are only good for generating LLVM IR > > > from OCaml, not for actually performing transformations on it > > > (there is no binding to retrieve the type of a value for example). > > > I'll probably be looking into fixing that in the near future, and > > > this may indirectly help your LLVM backend (if you intend to write > > > OCaml specific transformations on the LLVM IR). > > > > That's a lot of work. Wouldn't it be preferable to do the passes on > > the OCaml side and focus on generating high quality LLVM IR? > > Yes, that is probably a better approach (generating the optimized IR in > the first place). FWIW, just the basic existing bindings were still buggy last I looked. For example, HLVM had to use a workaround to add a dummy argument to a function with no arguments because the bindings didn't handle that case correctly. Ironing the bugs out of the existing bindings would be more useful than making them even bigger, IMHO. Going back to Richard's idea, writing an OCaml library that uses LLVM to JIT interface code on-the-fly as a replacement for writing separate C stubs would be incredibly useful and you could even use it to interface to LLVM itself more easily! Cheers, Jon.