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

Sebastian Sylvan sebastian.sylvan at gmail.com
Sat Aug 15 18:59:45 EDT 2009

On Sat, Aug 15, 2009 at 11:54 PM, John A. De Goes <john at n-brain.net> wrote:

> On Aug 14, 2009, at 9:34 PM, Sebastian Sylvan wrote:
> 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).
> That's because C has no effect system and is too low-level for an effect
> system. That's no argument against one in a high-level language similar in
> syntax to Haskell.

> Your point about safety in C has no relation to safety in a functional
> language with a sophisticated effect system.

I'm sorry, but I think it does. You're advocating that modifications to
mutable state shouldn't have sequential semantics, I'm pointing out that
this is the case today in C on many CPUs and it's a royal pain to work with
in practice (causing many almost-impossible-to-debug crashes). I would not
want functional languages to adopt something that's proven to be
insanity-inducingly difficult to use.

Sebastian Sylvan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090815/939fba25/attachment.html

More information about the Haskell-Cafe mailing list