[erlang-questions] Why do we need modules at all?

Jesper Louis Andersen <>
Tue May 24 12:26:51 CEST 2011


On Tue, May 24, 2011 at 10:06, Joe Armstrong <> wrote:
> Why do we need modules at all?

I think we need modules, but this post sparked a thought I have had
for some time now.

I'd like to have module renaming/namespacing!

Specifically, I want a mechanism by which I can clean up the naming
mess in the stdlib without affecting old programs. That is, I want to
be able to, at an application/module level, rename function calls in a
way such a way that can clean up parameter orders and so on. I don't
care about how the solution is. I am after the goal: Cleaning up the
stdlib mess.

You may argue this is a messy thing, but I think it is a necessity if
you want to move the standard library on:

* We can't alter existing functions because people rely on them.
* Existing functions are not consistent.

This is a social deadlock I want to break. In fact it is a deadlock I
think we can only break if we allow the coexistence of more than one
module with the same name (but stemming from different namespaces). I
don't want nesting. Just two levels, so I can say

-use_namespace(v2_modules).

in modules which use version two of the stdlib in which things are
sensibly named. At some point you can then flip around and compile old
code with a compatibility layer.


-- 
J.



More information about the erlang-questions mailing list