CACM Erlang article by Joe Armstrong
cacm.acm.org
cacm.acm.org
During the first module upgrade, data types from the newer module (2) can be incompatible with the data types from the older module (1).
Such incompatibilities are resolved dynamically during the upgrade procedure (implemented as a part of v2) which knows about type incompatibilities between versions 1 and 2.
After the upgrade from version 1 to 2, any subsequent module versions (e.g. 3) doesn't have to know anything about types from the initial module (1).
Another thing I forgot to mention, and it is more important than my first example, -- in Erlang, during the upgrade procedure, you can have two versions of the same module loaded simultaneously and their code can execute at the same time until all the code starts using functions from the second module. Basically, when you call a function, you can specify explicitly to call it the current module or from the new module. I can hardly imagine how you can get away with it in statically-typed language.
If you are interested in the topic I recommend reading Joe Armstrong's PhD thesis. It describes this and many other advanced topics in detail. Actually, it changed the way I think about concurrent and fault-tolerant systems and languages.
I'm not sure why being statically typed would make hot code loading impossible. Can't you always interject some transformation function between updates? At the very worse you could have code to serialize your data structure right before update, then another function after the update to deserialize and turn it into the new structure. Am I missing something?
Second, which is more important -- in my first example, I forgot to mention about the ability to use two versions of the same module at the same time. Check the thread below for more details.