Hacker News new | ask | show | jobs
by thomasfortes 2205 days ago
In erlang (in the BEAM vm to be more precise) you can update an application while it is running, it was a requirement for the language, even though these days it is a lot less common, its still possible.

The way that the BEAM does that it is that it store the old and the current version of the module, any new calls made will call the functions exported in the new module, but any process already running will call the functions of the old module.

But how do you handle types in a system like that, where the type of a message can change at runtime? There's no guarantees that your valid types that the compiler just approved will be valid at runtime...

learnyousomeerlang has this quote about rolling upgrades:

"We're getting into one of the most complex parts of OTP, difficult to comprehend and get right, on top of being time consuming. In fact, if you can avoid the whole procedure (which will be called relup from now on) and do simple rolling upgrades by restarting VMs and booting new applications, I would recommend you do so. Relups should be one of these 'do or die' tools. Something you use when you have few more choices."

https://learnyousomeerlang.com/relups#the-hiccups-of-appups-...