home

Hot Reloading

2024-12-09

The language I use for work is built off of the Erlang virtual machine. Some brainchild crawling out from Sweden and keeps me cozy running my servers.

Erlang was built to deal with mobile networks, phones, etc – and in such a domain so the essence is that it’s all unreliable. So you best design fault tolerance within it. The fault tolerance decided upon was to isolate Erlang virtual machine “processes” and Let Them Crash™ so famously decreed as any other indoctrinated erlang user will say the same things emphatically. With a smirk and exaggerated wink, manifesting their programming halo and mild disdain however much suppressed…

Not only is the fault tolerance baked in, but so came another artifact – now rarely used, though still amusing. Which of course is the title: Hot reloading. It is as it sounds. While the server program is running, “reload” or update the code. And it makes sense in the context of mobile networks: you ideally don’t want to have downtime, otherwise messages get lost. So just replace the wings while the plane is flying.

This has naturally fallen out of fashion for the same reasons why swapping out the propellers mid-flight isn’t the best course of action. The short excuse is that full reboots are much more deterministic.

If you like to do the popular thing where you compare your own living self as a program, perhaps it’s more appropriate to see it as a long-running process til death. Because when you shift from “program” to “process” then we can wonder amusing things, like how we do hot reloading all the time. Or whether parts of our psyche crash through neglect or years, forgettings and alcohol works too. Whatever it is so we’re replacing parts of ourselves while running, or fanning the server room flames.

If we’re always hot reloading, then the nondeterminism only accelerates, and within that nondeterminism, so one could more adequately explain addictions. The same as a Netflix engineering blogpost – where they deployed a memory leak, periodically bloating until it crashes the machine, and so the best bet was to randomly restart servers that had this faulty code running (spoilers: it worked out) – so if you’re all screwy in the head, you’re periodically restarting parts of your mind through your addictions. The agony rises while you don’t do anything, depending on how deep-rooted your sickness is. And so the only way is to keep restarting parts of the mind through your reboot sequence of choice.

Because you can’t hot-reload yourself out of some things. Frenetic researching around in a hopes to complete the logical errors, and yet sometimes it’s hardware failure, and then you look away from the child hospitals.

While I scroll around, so I think maybe I am seeking my next “hot reload” – finally some sort of completed function. Reducing the insanity for a moment. But I guess it’s always more of a hope to crash and reboot, figuring the nondeterminism is too much to reason out of. It seems to work as the local maximums do. But maybe one reads The Shortness of Life and avoids flying the whole mess into the sea for a day.