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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 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 03DD3BBCA for ; Mon, 12 May 2008 21:39:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At0SALI5KEjQOfEbZWdsb2JhbACBU4gsiA4SAh6aAg X-IronPort-AV: E=Sophos;i="4.27,475,1204498800"; d="scan'208";a="12505787" Received: from lgb-static-208.57.241.27.mpowercom.net (HELO sanddune.1969web.com) ([208.57.241.27]) by mail3-smtp-sop.national.inria.fr with ESMTP; 12 May 2008 21:39:14 +0200 Received: from [10.3.2.21] (zilles.1969web.com [10.3.2.21]) by sanddune.1969web.com (Postfix) with ESMTP id 14248BAD4AA; Mon, 12 May 2008 12:39:03 -0700 (PDT) Message-ID: <48289D4E.4050005@1969web.com> Date: Mon, 12 May 2008 12:41:02 -0700 From: Karl Zilles User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Arthur Chan Cc: Kuba Ober , caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Why OCaml sucks References: <200805090139.54870.jon@ffconsultancy.com> <200805120901.54129.ober.14@osu.edu> <74cabd9e0805121218r75725b23g906282a09dfd00d3@mail.gmail.com> In-Reply-To: <74cabd9e0805121218r75725b23g906282a09dfd00d3@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 inlining:01 higher-order:01 inlined:01 pet:98 sml:01 wrote:01 inline:01 corrected:01 caml-list:01 caml-list:01 functions:01 functions:01 arithmetic:01 Arthur Chan wrote: > > Yet, if you look at things in the light of "optimization is > depessimization", > you'd much rather have easier to read code, than code which is ugly > because > you preoptimized it by hand. This is why, for me, Ocaml has a long > way to go > to make it useful for run-of-the-mill production code. My pet peev is > performance penalty paid for writing in functional style where it > actually > makes sense -- say passing an arithmetic operator to a map-style > function. > > > What do you mean by this? What language would not incur this kind of > performance hit? Is F# able to optimize this out or were you referring > to something else? For Ocaml: "when inlining higher-order functions with known function arguments, those known function arguments are not themselves inlined." http://camltest.inria.fr/pub/old_caml_site/caml-list/1048.html (This is an old post, if things have changed I would love to be corrected.) sml can inline such functions, making passing + to a map style function potentially as efficient as writing a procedural loop.