[erlang-questions] Process Dictionary limitations??

Richard O'Keefe <>
Fri Oct 12 03:53:25 CEST 2012


On 12/10/2012, at 2:48 AM, Dmitry Belyaev wrote:

> Isn't this feature, I mean process dictionaries, much worse for functional nature of Erlang than parameterized modules?

"Much worse"?  I'm not sure how you would measure that.

Processes and message passing (which let you simulate
shared mutable variables) clearly cancel out properties
that you would otherwise expect a functional language
to enjoy, while the process dictionary and parameterised
modules do not.
> 
> Why aren't there any words about removing pdics but there are about functional pmods?

Because the process dictionary interface has been a
documented official this-isn't-going-away part of Erlang
for a long time, whereas parameterised modules have
always been this-is-experimental-use-at-your-own-risk-
but-we-TOLD-you sort of thing.

Modules with parameters in ML ('functors') are a very
powerful structuring tool, but they go with a number of
things Erlang is lacking, like nested modules, module
types ('signatures'), and a formal semantics for the
things, and still had several major problems that required
repeated redesign.  It may not be without significance
that the Haskell designers, willing to experiment boldly
in so many ways, refuse to take one tiny step in that
direction.

The ability to use frames as quasi-modules (if/when we get
frames) will provide an alternative.




More information about the erlang-questions mailing list