Hot loading and preprocessor [was: Re: the Hopwood design process]

Kostis Sagonas <>
Wed Mar 15 00:53:48 CET 2006


Richard A. O'Keefe wrote:

 > There really isn't anything that can be done with the processor that
 > could not be done better without it.

Quite a strong statement, but probably true.

 > In particular, one of the major things about Erlang is the module
 > system combined with hot loading, but the preprocessor subverts
 > the module system and causes dependencies between source units
 > that are not and cannot be tracked by the run time system.

I am not sure I get this part though. AFAIK, the Erlang run time
system does not track any dependencies between modules anyway --
modules can be hot (re)loaded on an individual basis and you get
"reload-and-pray" semantics when you do so and forget to update
modules that these modules depend on.

However, even if it did, dependencies could take preprocessing into
account.  For example, the compiler+loader could easily record
information of the form "the code of all this set of modules has
a dependency on these record declarations".
Even today, this info is present when compiling with +debug_info.

I certainly do not want to defend the preprocessor, but I do not
really see how the preprocessor is to blame for what is being
discussed here...  How are records different than e.g. changing
the types of data structures that some module obtains from some
other module and manipulates?

Cheers,
Kostis




More information about the erlang-questions mailing list