[erlang-questions] Ideas for a new Erlang
Sven-Olof Nystr|m
svenolof@REDACTED
Fri Jun 27 15:33:54 CEST 2008
Ulf Wiger writes:
> 2008/6/26 Sven-Olof Nystr|m <svenolof@REDACTED>:
> > In my opinion, one great advantage of Erlang over other languages that
> > use channels is that in Erlang, each process has a "standard" channel
> > that it normally takes input from. I hope that I was not unclear about
> > this, but that is a feature of Erlang that I had not intended to change.
>
> But if one of the reasons for wanting channels rather than selective
> receive on a single mailbox is to make it easier to reason about
> concurrency, wouldn't keeping an "unscoped" default channel
> complicate this reasoning?
Maybe. It would certainly be nice to know that if we call a function
in another module it cannot affect any of the channels of the current
process. Thus, there would be a clear distinction between functional
code and code that is involved in process communication.
OTOH, in Erlang there is a one-to-one relationship between processes
and mailboxes which often very natural. There is a similarity between
'self()' in Erlang and referring to the current object in
object-oriented languages (some oo languages actually use the keyword
'self').
I also suspect that it would be inconvenient to add the current
channel as an argument to all functions that perform process
communication.
> It's a bit like saying "global variables are bad, so we'll introduce
> local variables - but global variables are great, so you can have
> them too."
Only if you think that mailboxes are like global variables :-)
Sven-Olof
More information about the erlang-questions
mailing list