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] kprintf with user formatters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-22 (22:17)
From: skaller <skaller@u...>
Subject: [Caml-list] lazy evaluation: [Was: kprintf with user formatters]
On Fri, 2004-07-23 at 01:39, Pierre Weis wrote:
> However, the very match expression you
> mentioned has indeed something of a lazyness behavior, since it is
> indeed equivalent of an ``if ... then ... else ...'' construct, as
> I know you know :)

I'm intrigued! 

Felix has a side-effect free functional subsystem,
and I expected this to buy considerable optimisation
opportunities unavailable in Ocaml: in particular,
any functional code which is normally evaluated eagerly
can always be evaluated lazily (which the optimiser effects
by converting it to procedural goto-spagetti).

However, erroneous or non-terminating lazy code can't
be prematurely evaluated in either language
I'd kind of assumed this could be done in Felix,
but it is clear now this isn't the case.

This seems to indicate in hybrid languages like Ocaml 
and Felix well specified parts of the language must
be deemed eager or lazy: both languages support expicitly
procedural constructions, however even the functional
code in both languages seems to need the evaluation time
specified (to more extent than I'd believed previously..)

Curiously this seems to indicate that in the long run
Haskell compilers should be able to generate more efficient
code if only the optimisers are smart enough to prove
it is both correct and efficient to evaluate something

One of my friends is actually doing a thesis on this.
His technique is basically to make everything eager
by default, and then upgrade it to lazy if necessary
(rather than the other way around).

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