pid/1 are convenience functions in iex to “re-create” refs and pids from a string representation. There is also
pid/3 which works with integers.
A reference is a unique reference in an BEAM cluster. This is useful when you want a unique identifier for whatever reason (for example a transaction id). They are created with
:erlang.make_ref/0. A pid is a globally unique identifier to a process.
I agree that the help text for
pid could perhaps be improved. There purpose is to to be able to convert a pid/ref from a string representation into a ref/pid. Perhaps it should say “create a ref from a string representation of a ref”
iex(3)> r1 = make_ref()
iex(4)> ref(0, 633323164, 2506358787, 64295)