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

Joe Armstrong <>
Tue May 24 20:14:29 CEST 2011


On Tue, May 24, 2011 at 5:56 PM, Parnell Springmeyer <>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I really like the idea of packages - I'm not quite sure why everyone is
> against them... Even Racket has extended the syntax of Scheme to the
> point where they support packages and modules now; it's a very natural
> abstraction for the human mind IMHO.
>
> I would, personally, stop using (or fork) the language if I were forced
> to program connected to a DB.


Why? Who cares how the data is stored - the requirements on storage
would be never-loose-anything fast latency access form any machine

I'd imaging a fast local db, that synced with some cloud storage and
where you could work on-or off-line with periods of no net access.

If your machine were struck by lightening you should be ably to
resume on any other machine, possibly loosing a very small ammount of data.

I imagine a local copy of couchDB with off-site replicas would be ok for
this.



> If it were a local ets-like DB that
> started when the Erlang VM started, cool.


Ets is too fast - we don't need to be ets fast :-)


> But not an over-the-internet
> type of thing, this is a particularly bad idea too because some
> applications really do need to be network efficient; if my language adds
> overhead to my network because it needs to request the definition of a
> function over the internet, that is A Bad Thing.
>

It's a trade off - if you always store modified functions in the net the
most you can loose is one function. If you don't you might loose
a lot of work if your machine suddenly disintegrates.

Umm let's think - in a good day I might write 500 lines of code
say 500 * 50 bytes in 86400 seconds that's 0.3 bits/second

I might look at ten times as much code - but I'd cache that locally.

/Joe



>
> I don't like the idea loading everything when the VM starts. I much
> prefer (and wish Erlang did it this way) the concept of calling an
> import statement. I like being able to see what packages, modules, and
> functions another module is referencing.
>
> Additionally this solves the issue of pre-loading the entire namespace
> when the VM starts; you only import when you /need/ it.
>
> I am intrigued, however, by the idea of type signatures and finding
> functions based on their metadata - cool idea.
>
> In practice though, I would really hate maintaining the metadata for
> every function I've wrote! I much rather group common functions into a
> module and then annotate the module with metadata.
>
> Anthony Ramine <> writes:
>
> > Le 24 mai 2011 à 14:45, Joe Armstrong a écrit :
> >
> >> On Tue, May 24, 2011 at 1:56 PM, Max Lapshin <>
> wrote:
> >> Very strange topic for me.
> >>
> >> I'd like to know if there will be hierarchial modules in Erlang,
> >> because tree of packages is a rather good idea:
> >>
> >> No it's not - this has been the subject of long and heated discussion
> and is
> >> why packages are NOT in Erlang - many people - myself included - dislike
> >> the idea of hierarchical namespaces. The *dot* in the name has no
> semantics
> >> it's just a separator. The name could equally well be
> encoders.mpg.erlyvideo
> >> or mpg.applications.erlvideo.encoder - there is no logical way to
> organise the
> >> package name and it does not scale -
> >
> > packages are NOT in Erlang? Then the related code should be removed
> because
> > erl.lang.number:plus(1, 1) definitely works.
> >
> > Also, I think the Haskell guys would disagree about packages not scaling.
> >
> > --
> > Anthony Ramine
> > Dev:Extend
> > http://dev-extend.eu
> >
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
> >
>
> - --
> Parnell "ixmatus" Springmeyer (http://ixmat.us)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
>
> iQEcBAEBAgAGBQJN29UaAAoJEPvtlbpI1POLpSAH/ijpOgfq1F+AF140/aXZke6C
> EXrWaiFBOgna0lkKu4lmwusOebLbyoiPs9D9vstlVff7npZ4Zdw32fp9LRuBjwfY
> rgGesMBoUGNMtpzXuuduCH7CkZNCIrBXj8uvKOBlDxt5csOz8FCpxvKDOXZg/z0I
> bFMP0HTYj1pzC2ixk2RmlUdKdbMLCCriIU+n0R5f4lIEck1FcoDm233ZHv1Sv9QC
> 9PlQ4kF91H/CavPAdD/JX4sDp6NRTCjV/VWCUzDTOyK/11/fl4R7nAB61TXzkVmz
> tv3y5z5RCkfjlatgvGSQ3d9vRbSn5fQneguxMX54JHI0WTEcWZ3xCQZZ8QKPuhY=
> =Faf+
> -----END PGP SIGNATURE-----
> _______________________________________________
> 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/01b6204f/attachment.html>


More information about the erlang-questions mailing list