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

Tim Watson watson.timothy@REDACTED
Tue May 24 14:05:36 CEST 2011


> But plain module namespace is also ok. It would be impossible for me
> to work with 30K LOC with plain function namespace.

I think what Joe is getting at - he'll correct me if I'm wrong about
this - is to refer to functions not only by name, but by other
metadata as well. I'm not sure what this looks like empirically, as
like you I can't see how using only function names you could work with
a flat namespace. Looking up functions by other (additional) metadata
such as type signature, author, date, company, category (mutiples?),
pre/post conditions, safe guarantees, etc - that would work. In fact
if you think about a process engine (such as BPMS solutions and the
like) then process (i.e., function) is often selected dynamically
based on many attributes, not just name.

Just how this will work in practise as a replacement for existing
(shall we say normal) way of referring to a function that is in a
module, I could not say. But it is an interesting concept. Perhaps
using a URI as the name and thereby being able to have multiple URIs
representing the various different category-based paths to identify
the function - the "aliases" could then redirect to the direct,
uniquely named resource which would in turn return the function
metadata (and binary code presumably).



More information about the erlang-questions mailing list