Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: Ocaml for Scientific computing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-09-25 (20:48)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Re: Ocaml for Scientific computing
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:

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