Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: David Teller <David.Teller@univ-orleans.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: Why OCaml rocks
Date: Fri, 9 May 2008 11:29:33 +0100	[thread overview]
Message-ID: <200805091129.34171.jon@ffconsultancy.com> (raw)
In-Reply-To: <1210319906.6399.12.camel@Blefuscu>

On Friday 09 May 2008 08:58:26 you wrote:
> On Fri, 2008-05-09 at 01:39 +0100, Jon Harrop wrote:
> > 9. Deforestation: Brian says "Haskell has introduced a very interesting
> > and (to my knowledge) unique layer of optimization, called
> > deforrestation". True, of course, but useless theoretical piffle because
> > we know that Haskell is slow in practice and prohibitively difficult to
> > optimize to-boot. Deforesting is really easy to do by hand.
>
> Are you sure or is that just a troll?

My point is that actual performance on real code is what matters and not the 
number of optimizations that might theoretically apply. From the measurements 
I have seen and done, Haskell is substantially slower despite its many extra 
optimizations. Also, the Haskell community are very quick to cite useless 
superfluous academic piffle that is of no practical use. They have a lot of 
very fast Fibonacci number generators, for example.

We investigated alternative languages to diversify into last year and Haskell 
was one of them. The single biggest problem with Haskell is that it is wildly 
unpredictable in terms of performance and memory consumption. I asked many 
specialists what they thought of Haskell for Scientists and they all advised 
me to forget the idea. The next biggest problem is that it is as commerce 
unfriendly as OCaml (e.g. no DLLs).

At last year's CUFP, a Haskell user from industry explained how they had to 
drop to C/C++ whenever performance was relevant.

I received dozens of Haskell implementations of our ray tracer benchmark and 
performance varied enormously but only one person managed to write an 
implementation that gets within 3x the performance of OCaml, and he had spent 
his life writing optimizing Haskell compilers. I asked why his code was fast 
and he said it is too difficult to explain why. And that is a tiny program.

The Haskell mailing lists are full of people asking why their programs run so 
slowly. The response is generally to litter the code with strictness 
annotations and then resort to unsafe operations. There is virtually no 
usable information explaining how to optimize Haskell code.

In contrast, OCaml is easy to optimize by following simple well-documented 
rules and can achieve excellent performance.

> Supero seems to improve enormously Haskell's performances and the Shootout
> already shows Haskell beating OCaml in several tests.

The shootout is completely flawed by design. Just ignore it.

Also, they are running legacy hardware and OCaml does much better on modern 
64-bit machines. For example, they claim that Haskell is 50% faster on binary 
trees but running the test here, OCaml is 40% faster. They claim Haskell is 
60% faster on nbody by here OCaml is 60% faster.

> > 10. Limited standard library: I agree but this is only an issue because
> > we are not able to fix the problem by contributing to the OCaml
> > distribution.
>
> That's the whole idea of Community Caml / Batteries Included. Really, feel
> free to contribute.

I thought Community OCaml was about tacking things on externally using macros 
and extra libraries.

> > . Pattern matching over lazy values.
>
> Have you looked at the Patterns project on Google ? It provides
> pattern-matching over lazy values. I've used it in conjunction with my own
> lazy list module [1] to port Graham Hutton's Countdown problem from
> Haskell, and it works.

I had not seen that. I'll check it out, thanks.

> > I believe these can be fixed by creating a new open source functional
> > language for Linux based upon LLVM. However, the lack of a suitable GC is
> > a complete show stopper. The JVM is the only thing that comes close and
> > it is unable to support tail calls without a catastrophic performance
> > cost, i.e. so bad that you might as well write an interpreter.
>
> Why a full new language? I may understand the interest of writing a new 
> compiler for OCaml (or whichever other language) and gradually improving
> the forked compiler, but that's a different story altogether.

A concurrent GC is the only major issue. Everything else is comparatively 
easy.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e


  reply	other threads:[~2008-05-09 10:34 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09  0:39 Why OCaml sucks Jon Harrop
2008-05-09  1:11 ` [Caml-list] " Matthew William Cox
2008-05-09  5:10   ` [Caml-list] Re: Why OCaml **cks Jon Harrop
2008-05-09  4:45 ` [Caml-list] Re: Why OCaml sucks Arthur Chan
2008-05-09  5:09   ` Jon Harrop
2008-05-09 11:12     ` [Caml-list] Re: Why OCaml rocks Gerd Stolpmann
2008-05-09 11:58       ` Gabriel Kerneis
2008-05-09 12:10         ` Concurrency [was Re: [Caml-list] Re: Why OCaml rocks] Robert Fischer
2008-05-09 12:41         ` [Caml-list] Re: Why OCaml rocks Gerd Stolpmann
2008-05-09 12:49         ` David Teller
2008-05-09 18:10       ` Jon Harrop
2008-05-09 20:40         ` Gerd Stolpmann
2008-05-09 20:55           ` Berke Durak
2008-05-10 10:56             ` Gerd Stolpmann
2008-05-09 21:00           ` Till Varoquaux
2008-05-09 21:13             ` Berke Durak
2008-05-09 22:26               ` Richard Jones
2008-05-09 23:01                 ` Berke Durak
2008-05-10  7:52                   ` Richard Jones
2008-05-10  8:24                     ` Berke Durak
2008-05-10  8:51                       ` Richard Jones
2008-05-13  3:47           ` Jon Harrop
2008-05-09 22:25         ` David Teller
2008-05-09 22:57           ` Vincent Hanquez
2008-05-10 19:59           ` Jon Harrop
2008-05-10 21:39             ` Charles Forsyth
2008-05-11  3:58               ` Jon Harrop
2008-05-11  9:41                 ` Charles Forsyth
2008-05-12 13:22             ` Richard Jones
2008-05-12 18:07               ` Jon Harrop
2008-05-12 20:05                 ` Arthur Chan
2008-05-13  0:42               ` Gerd Stolpmann
2008-05-13  1:19                 ` Jon Harrop
2008-05-13  2:03                   ` Gerd Stolpmann
2008-05-13  3:13                     ` Jon Harrop
2008-05-12 20:33             ` Arthur Chan
2008-05-12 21:22               ` Till Varoquaux
2008-05-09 13:00     ` [Caml-list] Re: Why OCaml sucks Ulf Wiger (TN/EAB)
2008-05-09 17:46       ` Jon Harrop
2008-05-09 18:17         ` Ulf Wiger (TN/EAB)
2008-05-10  1:29           ` Jon Harrop
2008-05-10 14:51             ` [Caml-list] Re: Why OCaml **cks Ulf Wiger (TN/EAB)
2008-05-10 18:19               ` Jon Harrop
2008-05-10 21:58                 ` Ulf Wiger (TN/EAB)
2008-05-10 18:39               ` Mike Lin
2008-05-12 13:31           ` [Caml-list] Re: Why OCaml sucks Kuba Ober
2008-05-12 18:18             ` Jon Harrop
2008-05-12 13:13   ` Kuba Ober
2008-05-12 19:32     ` Arthur Chan
2008-05-09  6:31 ` Tom Primožič
2008-05-09  6:46 ` Elliott Oti
2008-05-09  7:53   ` Till Varoquaux
2008-05-09  7:45 ` Richard Jones
2008-05-09  8:10   ` Jon Harrop
2008-05-09  9:31     ` Richard Jones
2008-05-09  7:58 ` [Caml-list] Re: Why OCaml rocks David Teller
2008-05-09 10:29   ` Jon Harrop [this message]
2008-05-09 13:08     ` David Teller
2008-05-09 15:38     ` Jeff Polakow
2008-05-09 18:09       ` Jon Harrop
2008-05-09 20:36         ` Berke Durak
2008-05-09 22:34         ` Richard Jones
2008-05-14 13:44           ` Kuba Ober
2008-05-09  8:29 ` constructive criticism about Ocaml Ulf Wiger (TN/EAB)
2008-05-09  9:45 ` [Caml-list] Re: Why OCaml sucks Vincent Hanquez
2008-05-09 10:23   ` [Caml-list] Re: Why OCaml **cks Jon Harrop
2008-05-09 22:01     ` Vincent Hanquez
2008-05-09 22:23       ` David Teller
2008-05-10  8:36       ` Christophe TROESTLER
2008-05-10  9:18         ` Vincent Hanquez
2008-05-09 11:37   ` [Caml-list] Re: Why OCaml sucks Ralph Douglass
2008-05-09 13:02     ` [Caml-list] Re: Why OCaml rocks David Teller
2008-05-09 12:33 ` not all functional languages lack parallelism Ulf Wiger (TN/EAB)
2008-05-09 18:10   ` Jon Harrop
2008-05-09 20:26     ` Ulf Wiger (TN/EAB)
2008-05-12 12:54 ` [Caml-list] Re: Why OCaml sucks Kuba Ober
2008-05-12 14:16   ` Jon Harrop
2008-05-13 13:33     ` Kuba Ober
2008-05-13 13:49       ` Robert Fischer
2008-05-13 14:01         ` Brian Hurt
2008-05-13 14:13           ` Robert Fischer
2008-05-13 15:18             ` Berke Durak
2008-05-14  4:40             ` Kuba Ober
2008-05-13 14:25           ` Gerd Stolpmann
2008-05-14  4:29           ` Kuba Ober
2008-05-12 13:01 ` Kuba Ober
2008-05-12 19:18   ` Arthur Chan
2008-05-12 19:41     ` Karl Zilles
2008-05-13 13:17     ` Kuba Ober

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200805091129.34171.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=David.Teller@univ-orleans.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox