Version française
Home     About     Download     Resources     Contact us    
Browse thread
Help me find this pdf
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andreas Rossberg <rossberg@m...>
Subject: Re: [Caml-list] Re: Help me find this pdf
On Oct 19, 2007, at 16.48h, Robert Fischer wrote:
> There's a philosophical difference here between Haskell and Ocaml.   
> Haskell considers it harmful (they call it "impure") for the  
> programmer to know when X is evaluated, and (by implication)  
> therefore considers it acceptable for Heisenbugs and vague  
> semantics to be standard aspects of the language.  Ocaml, on the  
> other hand, requires much more explicitness, particularly around  
> theoretically beautiful but potentially harmful things like lazy  
> evaluation.

Wow, that made my FUD sensors go wild. To counter some of the  
misinformation:

1. Purity and evaluation regime are separate issues. You can very  
well have a pure language that is eager.

2. However, in a pure language the details of evaluation order are  
largely immaterial to its semantics, which obviously is an advantage.

3. Lazy evaluation by itself is as precise an evaluation scheme as  
eager evaluation. There is no inherent vagueness.

4. In fact, the semantics of OCaml arguably is more vague than that  
of Haskell, because evaluation order is underspecified (and can vary  
between compilers) even where it matters semantically. Haskell only  
leaves it unspecified where it is not semantically observable.

5. The problem with Haskell and laziness on the other hand is not  
semantic bugs, but the fact that it can make space complexity hard to  
predict sometimes.

6. Nevertheless, evaluation is fully deterministic, thus it certainly  
cannot cause Heisenbugs, neither semantically nor performance-wise.

- Andreas