[erlang-questions] If you could rename ports, what would you call them?

Joe Armstrong erlang@REDACTED
Tue Oct 5 17:04:18 CEST 2010


On Tue, Oct 5, 2010 at 11:02 AM, Masklinn <masklinn@REDACTED> wrote:
> On 2010-10-05, at 10:34 , Joe Armstrong wrote:
>> Pids
>>
>> There shouldn't be ports in the language at all (sorry) - ports should
>> in all circumstances
>> behave and be indistinguishable from Pids.  open_port(...) should
>> return a Pid and not a port.
>>
>> We should reduce the number of concepts in the langauge not increase
>> them - all in the
>> name of conceptual integrity.
>>
>> /Joe
>
> But they *are* two different concepts.

But they shouldn't have been different - sure they have a differnt way
of being created.

There should be the notion of "creating a thing that behaves like a
process" that is actually
not a process, which which behaves like a process. Ets tables and
ports should have
been "things that behave like processes" - they should respond to messages and
send exits when they die and so on. If they had behaved like processes
then life would be
easier and more regular ... If ports where pids then one would be able
to access ports on
remote nodes via their pids (just like remote pids in distributed erlang).


 Even if at the usage level they behave the same way from the POV of
an external process, they're not created the same way (``open_port``
vs ``spawn`` and a bunch of control functions dumped into the
``erlang`` module), and you also need to distinguish them when
*implementing* them. And I'm guessing that's where Tony is looking for
a better name.
>
> If down the line ports and pids are better merged (in both external interface and implementation details) then maybe "ports" as a name/concept can disappear, but I don't think that's the case at the moment, you still need to refer to them as entities separate from pids when talking about implementing things in erlang.

The erlang view of the world is "everything is a process" - all you
should need to know
is how to create a process and what protocol the process obeys -
otherwise these things should
obey "process semantics" this should be true for ets tables and ports ...

/Joe


More information about the erlang-questions mailing list