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

Bengt Kleberg <>
Tue May 24 12:39:18 CEST 2011


Greetings,

It would be very nice to have module renaming/namespacing that allowed
me to do the following:
The modules "misc_lib" and "misc_lib_helper" from developer A should be
able to call each other with their original names.
The modules "misc_lib" and "misc_lib_helper" from developer B should be
able to call each other with their original names.
I should be able to call all 4 at the same time with names that I have
create/renamed.

So, I need to load modules as a set/application/??? that renames them
outside of that set (it would be ok to have the same prefix added to all
of them), and still allows the files in the set/application/??? to keep
using to the old names.


When it comes to improving stdlibs I suggest that we create new, better
modules. Keep the old ones (for ever?) but print a big "deprecated" all
over the man pages.


bengt

On Tue, 2011-05-24 at 12:26 +0200, 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!
> 
> 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.
> 
> 




More information about the erlang-questions mailing list