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

Jeff Schultz jws@REDACTED
Wed Oct 6 02:14:23 CEST 2010

On Tue, Oct 05, 2010 at 05:04:18PM +0200, Joe Armstrong wrote:
> 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).

This sounds good to me, but I have a practical question:

    How much existing code would break if ets:new or open_port
    returned a pid?  Is there a lot, or very little?

Your protocol/1 idea would make it easy to adapt is_port to only
succeed on pids created by open_port, but there's probably code
somewhere that handles both ordinary processes and ports and that
distinguishes them by is_pid.

For that matter, what would we do with the named_table option to
ets:new?  Make it register the process?

    Jeff Schultz

More information about the erlang-questions mailing list