3 ms·
Is this even possible with languages like Rust and C?
by gefhfff 5y ago
Is this even possible with languages like Rust and C?
- ximeng 5y agoZig is working on hot reloading, needs compiler and linker level support. https://github.com/ziglang/zig/issues/68 https://github.com/ziglang/zig/issues/68 That issue has some links to people doing it in C/C++.
- yissp 5y agoQuirky as it is, I believe Terry Davis's TempleOS actually allowes REPL-style development in its C dialect (HolyC). I'm not sure how exactly it works, but it's able to compile and execute statements as you type them in.
- thurn 5y agoMun is a subset of Rust syntax which supports hot-reloading, I think that could be a good direction to enable this sort of thing for the most frequently-changing business logic.
- maccard 5y agoI've used Live Plus Plus [0] succesfully for a few years in C++. It's great. [0] https://liveplusplus.tech/ https://liveplusplus.tech/
- nextaccountic 5y agoYes. On Rust specifically https://fasterthanli.me/articles/so-you-want-to-live-reload-rust https://fasterthanli.me/articles/so-you-want-to-live-reload-... (discussed here https://www.reddit.com/r/rust/comments/j0ajdy/so_you_want_to_livereload_rust/ https://www.reddit.com/r/rust/comments/j0ajdy/so_you_want_to...) And then there's this crate https://docs.rs/live-reload/0.2.0/live_reload/ https://docs.rs/live-reload/0.2.0/live_reload/ which works on the same principles as the article above, and is based on C code (i.e. the same approach works for C). On the documentation there's links to "Interactive Programming in C" http://nullprogram.com/blog/2014/12/23/ http://nullprogram.com/blog/2014/12/23/ and "Loading Game Code Dynamically" https://www.youtube.com/watch?v=WMSBRk5WG58 https://www.youtube.com/watch?v=WMSBRk5WG58 (this video by Casey Muratori is btw where I first heard about this technique) There's a bunch of other libraries that work the same way, and some example code that can do this. I can find https://github.com/irh/rust-hot-reloading https://github.com/irh/rust-hot-reloading and https://github.com/porglezomp-misc/live-reloading-rs https://github.com/porglezomp-misc/live-reloading-rs and https://github.com/xixixao/hot-reload-rs https://github.com/xixixao/hot-reload-rs and https://github.com/emoon/dynamic_reload https://github.com/emoon/dynamic_reload And there's https://github.com/draivin/rust-hotswap https://github.com/draivin/rust-hotswap which has a nice API but uses a deprecated rustc internal API and doesn't build anymore. Anyway there was a library that did this in a more elegant way and I just can't find it (perhaps it was rust-hotswap?).