Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Recursive lists
[ 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@p...>
Subject: Re: [Caml-list] About Obj (was Recursive lists)
brogoff wrote:
> 
> I remembered shortly after I asked that Alice ML also provides a way to handle
> these tail recursive (modulo cons) functions by providing a library for
> Prologish logical variables called "promises" in that dialect. Neat idea, and
> useful for more than tail recursive lists, but I wonder how efficient the
> implementations are.

Promises surely would be overkill for just tail recursion. And I'm 
afraid that the general overhead their presence introduces may well be 
larger than the bit of efficiency you can squeeze out by making List.map 
tail recursive. (It is similar to laziness, and Alice uses reflective 
just-in-time compilation to avoid redundant tests for promised values.)

Promises, and more generally futures, have been introduced for 
light-weight concurrent programming with implicit dataflow 
synchronisation. They enable coding all kinds of concurrency 
abstractions. You can also use promises to e.g. construct data 
structures top-down (of which tail recursive map or append functions are 
simple instances), but that rather is a neat side effect and not their 
primary motivation.

	- Andreas

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

Let's get rid of those possible thingies!  -- TB

-------------------
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