Edit: He does mention some kind of data persistence system, but I think he vastly underestimates how complex and insidious this problem will be.
Edit: He does mention some kind of data persistence system, but I think he vastly underestimates how complex and insidious this problem will be.
[0] https://www.erlang.org/doc/design_principles/release_handlin...
[1] https://www.erlang.org/doc/man/gen_server.html#Module:code_c...
It's... cumbersome, let's put it this way, and mind you, Erlang makes it happen at "safe" points, when the code being replaced is idle.
For Common Lisp, here's a toy example[1], and spec[2].
[1] https://malisper.me/debugging-lisp-part-3-redefining-classes... [2] http://www.lispworks.com/documentation/lw70/CLHS/Body/04_cf....
liballocs is an approach for providing high-level facilities such as changing structure layout to a a low-level Unix environment.
It's really not that different from doing a DB table update.
I haven’t checked these links in quite some time: https://gist.github.com/macintux/6349828
And if you don’t mind videos, here’s my talk from Midwest.io (RIP) on the philosophy behind Erlang & its VM: https://youtu.be/E18shi1qIHU
At Basho, we would load module fixes into Riak instances for customers...I hesitate to say "fairly regularly" because it's been long enough and I had limited visibility into it, but it certainly seemed like a routine operation.
The full "upgrade the entire application" hot loading definitely requires more planning than most companies will ever be willing to do.
That's how you'd handle it in Lisp. Smalltalk has something similar, but I'm less familiar with the internals for it. No restart needed, but it requires a runtime that is able to track data instances by type. You could build that onto C, though. Probably with a custom allocator that was passed some symbol indicating the structure type so it could report on instances for executing an update. Would be hard, though, to do this without invalidating pointers when the size changes. You'd probably end up with an extra level of indirection as a consequence to make it simpler (for the runtime author, not for the end user).