Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Strange performances
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-01-24 (22:48)
From: Christophe Raffalli <christophe.raffalli@u...>
Subject: Re: [Caml-list] Strange performances

> The downside of such an approach would be different evaluation orders
> for data constructors and functions. There is no theoretical problem
> in it, since they form different syntactic classes in ocaml, but
> people may not be completely aware of that.
There is already a mixed evaluation order in OCaml :
"&&", "||", ";", ... are left to right (and the logical connective are 
lazy moreover)
So left to right everywhere except in function applications would be the 
deterministic strategy for OCaml ...

The current situation with OCaml unspecified evaluation order is really 
not satisfactory.
Let aside that it makes proving code more difficult (more cases to check).
But, even if you try to make your code independant from the evaluation 
order ...
how can you be sure ? This would require a random evaluation order to 
catch your potential bugs.
(like the old days Apple's SANE library with a random least significant 
bit to know how your
computation depends on rounding errors, I am missing that one ;-)
> Another unrelated problem seldom noted is that for records, the
> evaluation order is that of the record definition, not that used when
> creating it. And the same thing is true for labelled functions.
> So you cannot expect the evaluation order to be exactly the one
> appearing in the code.
Argh ! Not nice that one ? For what reasons ?

Best regards,