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

Joe Armstrong <>
Tue May 24 13:28:53 CEST 2011


On Tue, May 24, 2011 at 12:26 PM, Jesper Louis Andersen <
> wrote:

> 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!
>

I agree - I still like the good 'ol Knuthian way - start with source file,
then add patch files.

You could make a language could make a language construct for this.

   new_foo = alias foo/2


>
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110524/1eb13c82/attachment.html>


More information about the erlang-questions mailing list