Why Erlang is the best concurrent language available

Daniel Dudley <>
Fri Jan 24 17:16:30 CET 2003

Your reference to Prolog compilers that keep a pointer to
the end of the list is what I was thinking about in my
last message (to Luke). Yes, it would be nice to see this
implemented in Erlang, but then again there's list
comprehension... (I'll have to give this some thought!)


----- Original Message ----- 
From: "James Hague" <>
To: <>
Sent: Friday, January 24, 2003 4:26 PM
Subject: Re: Why Erlang is the best concurrent language available 

> Note!  This completely off of the original subject! :)
> Luke Gorrie wrote:
> >But I reckon a seriously cool feature of the Erlang
> >implementation is that you *can* build up a huge stack
> >and unwind it if you want to, which tends to be pretty
> >often for me. Consider the implementation of
> >'map' from lists.erl:
> >
> >  map(F, [H|T]) ->
> >      [F(H)|map(F, T)];
> >  map(_, []) -> [].
> Ah, but technically that's tail recursive modulo cons (i.e. the
> only thing keeping it from being tail recursive is that you need
> the result in order to build a cons cell).  If you were writing
> this in Scheme, you could keep a pointer to the end of the list
> and the whole thing would be tail recursive (and at least all of
> that nonsense would be hidden inside of map).  Some Prolog
> compilers do this automatically.
> (I don't think Erlang desperately needs this--though sure, ite
> would b cool--but lack of this is something that might look
> 'horrifying' to someone not used to writing code in functional
> languages.)
> P.S. I still love how list comprehensions have made map obsolete:
> map(F, L) -> [F(X) || X <- L].

More information about the erlang-questions mailing list