Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Generation of streams is slow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Generation of streams is slow
Hi,

On Sat, Jul 14, 2001 at 11:08:09AM -0700, Alexander V. Voinov wrote:

>     h::(make_tail arg1 argN),
> that is
> 	CALL make_tail
> 	CONS
> and change them to
> 	PREPARE_CONS
> 	CALL make_tail
> the scope of tail recursion optimization would increase. But it's
> unlikely that this idea didn't come to developers. Which may mean that
> this [being not that simple] is impossible.

It supposes that the order of evaluation could be variable. If we
imagine a constructor C with 5 parameters. If we evalutate:

      C (a, b, c, d, e)

Here, the order of evaluation is a-b-c-d-e or e-d-c-b-a, I don't know,
but in some logical order. If the tail recursion is, say, on the third
parameter c, it supposes that a, b, d and e be evaluated before. And
what policy use if, say, d is another tail recursion?

In OCaml the evaluation order is not - supposed to be - specified. In
this case, it would less be specified, since it could change depending
on the parameters. Interesting... But I don't know if it is possible to
implement that in the code generation.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr