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=AWL autolearn=disabled version=3.1.3 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 E3BAABC6C for ; Tue, 25 Sep 2007 22:48:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABsR+UbUnw6Flmdsb2JhbACCNot2AQEBAQcEBg8RBw X-IronPort-AV: E=Sophos;i="4.20,297,1186351200"; d="scan'208";a="1464010" Received: from pih-relay06.plus.net ([212.159.14.133]) by mail1-smtp-roc.national.inria.fr with ESMTP; 25 Sep 2007 22:48:58 +0200 Received: from [80.229.56.224] (helo=beast.local) by pih-relay06.plus.net with esmtp (Exim) id 1IaHKz-0006ta-R8 for caml-list@yquem.inria.fr; Tue, 25 Sep 2007 21:48:58 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: Ocaml for Scientific computing Date: Tue, 25 Sep 2007 21:38:48 +0100 User-Agent: KMail/1.9.7 References: <2a1a1a0c0709251027v6dc42b38g1138b09f5627dbca@mail.gmail.com> <1190745994.12747.41.camel@rosella.wigram> In-Reply-To: <1190745994.12747.41.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709252138.49050.jon@ffconsultancy.com> X-Spam: no; 0.00; ocaml:01 ocamlopt:01 gcc:01 ocaml:01 conceptually:01 blogs:98 frog:98 wrote:01 wrote:01 caml-list:01 unsafe:01 bounds:02 bounds:02 shootout:02 numerical:03 On Tuesday 25 September 2007 19:46:34 skaller wrote: > On Tue, 2007-09-25 at 13:27 -0400, Mike Lin wrote: > > On Sep 25, 7:11 am, Alex Mikhalev wrote: > > > > For numerical computing, I wish ocamlopt would do at least basic loop > > optimizations, like hoisting invariant values -- this type of stuff is > > easily done manually, but often at the expense of code readability. > > Gcc does this quite well I think. However in a higher level > procedural language (like Ocaml and Felix) it is very hard > to get right and potentially very expensive. I'm not sure that it is conceptually more difficult to do similar things for OCaml but my vote goes to hoisting bounds checks. I don't like having to write unsafe code by hand in OCaml and F# does a great job of improving performance by hoisting bounds checks. I discussed some of the benchmarks where F# is faster than OCaml recently on one of our blogs: http://ocamlnews.blogspot.com/2007/09/spectral-norm.html For some reason, the current implementation of spectral-norm on the shootout leaves out some important optimizations in OCaml. F# doesn't require these optimizations to be done by hand. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists/?e