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

Frédéric Trottier-Hébert <>
Tue May 24 16:44:42 CEST 2011


One issue is that while plain files are abstractions, they are a very common one, compatible with most systems you will see in use, and on which many tools have been developed, including source control, IDEs, e-mail attachments, documentation and conversation.

I do not see the idea of a database as inherently bad -- it could be a good supplement to the developer, much like module_info is for modules. Using a DB for everything (with unique IDs) could solve the problem of nested dependencies, where library A needs library B 1.1.2 while library C needs B 1.2.0 and both can not be loaded at once.

But the social problems it creates -- how to communicate about functions, how to regroup collections of them in an exportable way, how to version them, how to patch them, how to reload them, etc. are not worth the change, I believe. 

The code server or the VM could likely use any representation it likes for these, but the developers are used to one way of doing things, including existing projects. This isn't only a question of compatibility with older code, but also with developers. I think I could welcome a good function/module database in Erlang, something that could be as responsive as erldocs.com, but could be integrated straight to the shell or something that makes the developer's life easier and maintenance of code easier. I doubt switching to database would simplify the issues at hand. To me it sounds like we'd solve a problem, but create a bunch more that were already considered solved.

It might be that everything was built on faulty assumptions, but then this sounds like the whole thing would need to be re-worked from scratch, not just the current module system.

You might want to look at the way PLaneT is doing things for racket, too (http://docs.racket-lang.org/planet/Using_PLaneT.html?q=planet) You can basically import Racket/Scheme module from a server, either at run time or at build time.

--
Fred Hébert
http://www.erlang-solutions.com



On 2011-05-24, at 10:22 AM, Joe Armstrong wrote:

> 
> 
> On Tue, May 24, 2011 at 4:10 PM, Max Lapshin <> wrote:
> I can't imagine myself working with system, that uses non-plain files
> for storing source code.
> Nobody will fix for me Textmate, git or ack to work with this database.
> 
> Why not? - a plain text file is an abstraction - in reality its a collection of magnetised zones
> on a disk, or electron spin states or something, this gets turned into a collection of
> bits, the bits are rendered in a editor. Plain text doesn't exist - it's just an abstraction.
> 
> The underlying representation of the data you see in a browser may come from a file
> or as the result of a datebase query, you will  never know which it was.
>  
> 
> Modules give your clear structure of functions. Without them you will
> end with  mpegts_encode, mpegts_decode,
> and will break your head when there will be 3 or 4 underscores in name.
> 
> or should the name be encode_mpegts and decode_mpegts the problem with structured names
> is choosing the name - not the fact there is structure in the name.
> 
> Imagine the www was just one big structured name and there were no search engines
> how would you ever find anything?
> 
> /Joe
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110524/c85d76b5/attachment.html>


More information about the erlang-questions mailing list