English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] laziness
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-05 (14:07)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] laziness
On Sun, 2004-09-05 at 20:50, Jon Harrop wrote:

> Are you asking if it would be productive to change the specs to something like 
> in-order evaluation? 

Thats the kind of question I'm asking (and others like it).
A recent post actually discussed a language with a more complex
evaluation strategy aimed at better optimisation opportunities.

> I'm no expert but I think the non-specific order of 
> evaluation is a good opportunity for optimising and the strictness vs 
> laziness choices set OCaml in a nice position with regard to imperative 
> programming.

I have some difficulty with the loss of referential transparency
in Ocaml. Yes you can write purely functional code, but then at least
one reason for eager evaluation (side effects) is lost.

> I'd have thought that you cannot determine evaluation order in a purely 
> functional language and, therefore, you couldn't distinguish between eager 
> and lazy evaluation in this case.

That isn't so if you can have functions that fail or fail to terminate.
In those case laziness matters. Clearly that's more cases than
you'd guess, otherwise Haskell would be a pointless language:
I'm not a Haskell programmer but I imagine the laziness is actually
exploited (just as Ocaml programmers exploit HOF's and closures
so routinely we forget we're doing it until some C++ programmers
asks if we actually use such advanced features .. :)

John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners