[erlang-questions] Why we need a -module() attribute?

Raoul Duke <>
Thu Feb 25 23:48:28 CET 2016


> How could I make it more explicit?
> A Haskell module can refer to another module by one (or more!) internal
> names
> which are in no way coupled to the file system and are in no way coupled to
> the
> name the module believes it has.  The name a module has *is* coupled to the
> file system.

What I was meaning was not that you aren't explicit, but that on the
whole I don't think it is so bad that it isn't perhaps worth
considering as better than the current status quo. Food for thought.

> Summary: there are several "OK, this is just tolerable, we can limp along
> with this" hierarchical module systems out there, but as yet, no outstanding
> "wow, gotta have this", especially for a dynamic distributed language.

What are the root causes?
+ People want to use "human" names for things.
+ We want unambiguity. (Too bad we don't include versions in the names?)
+ People do not want to have to type a lot of ascii: labor saving
usability; somewhat about readability, too.
+ We shouldn't have to alter the ascii of an already existing program
just because somebody added a new class in one of the 3rd party libs
that's used.
+ etc.

So far I think the "let users rename their namespace" isn't all that
bad. And I don't really like good-enough preventing the-perfect, so I
say that not as some fan boy of the approach, I just also haven't seen
or thought of anything better. It is an interesting thing to ponder.


More information about the erlang-questions mailing list