fainpul 2 days ago

For anyone interested in this: Tsoding (Twitch and YouTube streamer of "recreational programming") demonstrates this in one of his projects, where he hot reloads a dynamic library without interrupting the main program, to test different functionality.

https://youtu.be/Y57ruDOwH1g?si=feGioEeSZ5eborb3&t=84

2
yencabulator 1 day ago

Here's an operating system kernel in Rust that can hot load/unload modules at ELF object boundaries, made safe by trusted compiler allowing only safe Rust:

https://www.theseus-os.com/

Upgrading a module in a way that changes its data structures still requires writing a converter from the old format to new.

torginus 2 days ago

This is cool and all, but the problem with doing this in C, is if you accidentally do a memory corruption bug while you're just messing about with the code, now you're forced to restart.

Not a problem in a toy app, but in something like a huge program, it can be a PITA to reload everything and get back to where you were.

throw10920 2 days ago

Yeah, C really does not support this as a language (or implementation) feature - it's something that can be hacked in, with a lot of difficulty, inconvenience, and loss of safety guarantees.

uecker 2 days ago

eBPF for apps?