DDC compiler and effects; better than Haskell? (was Re: [Haskell-cafe] unsafeDestructiveAssign?)

Sebastian Sylvan sebastian.sylvan at gmail.com
Fri Aug 14 23:34:33 EDT 2009


On Sat, Aug 15, 2009 at 3:55 AM, John A. De Goes <john at n-brain.net> wrote:
>
> If you don't like the file system, consider mutable memory. An effect
> system will tell me I can safely update two pieces of non-overlapping,
> contiguous memory concurrently, even in different threads if the complexity
> so justifies it.


I'd like to point out that this relaxation of sequencing for memory
operations is already in effect in C on many CPUs. Even though you write
things sequentially, it doesn't actually happen sequentially unless you
explicitly say so with memory barriers. This causes massive head-aches and
horrible bugs that are almost impossible to track down whenever you actually
do depend on the order (usually in multi-threading scenarios, e.g. lockless
data structures).

The point is, the safer option is to enforce a sequential model (like
Haskell does), since that way you can always rely on ordering even if you
don't even realise you need to, and there's plenty of practical experience
indicating that the other option (explicit barriers to indicate when
something isn't commutative) is sheer madness.


-- 
Sebastian Sylvan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090814/94dddbac/attachment.html


More information about the Haskell-Cafe mailing list