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: brogoff <brogoff@s...>
Subject: Re: [Caml-list] About Obj (was Recursive lists)
On Thu, 14 Oct 2004, Andreas Rossberg wrote:
> 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.

Thanks, I suspected as much, but wasn't sure. Alice looks like an interesting
language, but I suspect (given it's Mozart/Oz heritage) that the implementation
would appeal to me less than OCaml on performance and convenience issues.

I'd like to be able to write those list functions in the core language and have
performance equivalent to the Obj using versions or their equivalents. Nope,
not a huge annoyance given the workarounds (Obj, or a slower implementation
which has to reverse) but a "nice to have".  String and array size restrictions
are more annoying.

-- Brian

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