<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div>The gen_server module is used for three different things:</div><div><br></div><div>- as a collection of API function (left)</div><div>- a place to put the code that controls the gen_server process (middle)</div><div>- a place to describe the abstract notion of a gen_server behavior (right).</div><div><br></div><div>Ideally, I think those three usages should be separate language constructs, but probably not in separate files (or other kinds of units).</div><div><br></div><div>When using a gen_server, it would be nice if you did not have to expose the behavior api to the "user" of your module.</div><div><br></div><div><br></div><div>Currently, the module is the unit of code loading. I think we could use a bette mechanism, perhaps one that supports an STM-like thing in the VM to control the loading of a set of modules. I don't have much deep experience with code loading in Erlang (but do have it on Java), and it just seems to me that being able to control atomic loading of .. say a new version of an Erlang application would be good to have supported in the VM.</div><div><br></div><div><br></div><div>Gilad Bracha (who's working on Newspeak) has an excellent blog on new notions of modues that you should read. You can start here <a href="http://gbracha.blogspot.com/2009/06/ban-on-imports.html">http://gbracha.blogspot.com/2009/06/ban-on-imports.html</a></div><div><br></div><div>One of the things he's arguing is that modules should be VALUES. A "module" in newspeak is kind of a template (function), which take other module instances as arguments. So you hook up a system by applying such templates (possibly using letrec). </div><div><br></div><div><br></div><div>If we had a visual programming environment, then many things don't need a name. Self is an example of this (Self, the video: <a href="http://video.google.com/videoplay?docid=5776880551404953752#">http://video.google.com/videoplay?docid=5776880551404953752#</a>) </div><div><br></div><div>Kresten</div><div><br></div></body></html>