Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Why OCaml sucks
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Re: Why OCaml sucks
On Fri, May 09, 2008 at 09:10:12AM +0100, Jon Harrop wrote:
> On Friday 09 May 2008 08:45:09 Richard Jones wrote:
> > > 1. Lack of Parallelism: Yes, this is already a complete show stopper.
> >
> > Why can't you just fork off enough processes to cover each core?
>
> They need to share data, e.g. write results into the same matrix or
> mutate the same array.

You might want to look at the 'ancient' module.  While the common
understanding is that the shared data should be immutable, in fact
you'd be OK if all you want to do is mutate a simple array of unboxed
ints or floats[1].  Of course to an extent you're back to using manual
memory management, but if it's only a few structures that may be
acceptable.  Getting parallelism right is hard enough that programmers
should be forced to think about exactly which structures need to be
shared, rather than threads where the default is to share everything
and make the naive assumption that the programmer knows what they're
doing.

Rich.

[1] The real basis for the 'immutable restriction' is explained in the
documentation, along with exceptions, but it's complicated so I won't
go into it here.

-- 
Richard Jones
Red Hat