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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BBD82BC6B for ; Mon, 7 Jan 2008 18:00:53 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAObpgUeCcUBTn2dsb2JhbACQFAEBAQEHBAYJIJdE X-IronPort-AV: E=Sophos;i="4.24,254,1196636400"; d="scan'208";a="7535089" Received: from sigma957.cis.mcmaster.ca ([130.113.64.83]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 Jan 2008 18:00:53 +0100 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.mcmaster.ca [130.113.196.61]) by sigma957.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id m07H0Q6C001610; Mon, 7 Jan 2008 12:00:48 -0500 (EST) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id m07H0849015511; Mon, 7 Jan 2008 12:00:08 -0500 Received: from [99.235.248.61] (account carette@univmail.cis.mcmaster.ca HELO [192.168.1.101]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.3.12) with ESMTPSA id 197084975; Mon, 07 Jan 2008 12:00:09 -0500 Message-ID: <47825AA0.3020702@mcmaster.ca> Date: Mon, 07 Jan 2008 12:00:16 -0500 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Performance questions, -inline, ... References: <200801031128.30183.ober.14@osu.edu> <200801051936.23521.jon@ffconsultancy.com> <200801070848.40809.ober.14@osu.edu> <200801071441.48212.jon@ffconsultancy.com> In-Reply-To: <200801071441.48212.jon@ffconsultancy.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 5.3.3.310218, Antispam-Engine: 2.5.2.313940, Antispam-Data: 2008.1.7.84445 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='HTML_NO_HTTP 0.1, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Spam: no; 0.00; -inline:01 high-level:01 metaocaml:01 o'caml:01 monads:01 o'caml:01 metaocaml:01 ocaml:01 condensed:98 wrote:01 inline:01 inline:01 caml-list:01 bounds:02 lisp:02 Jon Harrop wrote: > You mean it might be possible to recover the performance of C from numerical > code with high-level abstractions? Yes. Indeed, I would like to see this > done. However, I've never heard of an implementation of any language that can > do this. > With MetaOCaml you can -- see either the long version http://www.cas.mcmaster.ca/~carette/scp_metamonads.pdf or the more condensed version http://www.cas.mcmaster.ca/~carette/metamonads/index.html With a little bit of work, you can achieve all of > The simplest route to recovering C performance here is: > > . Inline "( +. )". > . Inline "op1". > . Type-specialize "op1". > . Hoist bounds checks. > automatically. There are three drawbacks: 1) the code you write no longer looks like O'Caml but Lisp instead [can be fixed with enough campl4 hacking] 2) the error messages can be very difficult to figure out [could be improved a lot if monads were integrated in O'Caml] 3) metaocaml is not as well supported as ocaml Jacques