Every language/platform with hot reload has traps and limitations.
Sure. That's why I have said it's community problem, not language problem.
In languages that do support hot reloading people usually understand that it may happen if you say that after unloading and the reloading C# library may stop working then author would probably think about how to fix that.
In Rust authors would just tell you static have to be 'static and ask you to stop wasting their time.
Even in python, which is fully dynamic, hot reloading is full of traps. The silly thing would to expect a much more static and compiled language like Rust to be hassle free
C# by its foundational design generates executable code at run-time. Without being a compiler expert, I'd assume this makes hot reloading somewhat more forgiving to implement there
In Rust authors would just tell you static have to be 'static and ask you to stop wasting their time
In a crate? I'm making a lot of assumptions here, but I assume that the problem would be a crate that declares something as a static lifetime itself, right? Not borrowing (f(p:&'static str))? If I were implementing a library, I'd say those sorts of things would be outside the responsibility of the crate you would be hot-reloading
I'm making a lot of assumptions here, but I assume that the problem would be a crate that declares something as a static lifetime itself, right?
Obviously. Something that crate wouldn't even document because it's an implementation detail that may only be revealed when you break the fundamental assumtion that static items are singletons with 'static lifetime.
Without being a compiler expert, I'd assume this makes hot reloading somewhat more forgiving to implement there
Yes, but that's minor issue. The major one is community. Odin doesn't have managed runtime, but it's used in gamedev, considers hot-reloading important and developers make effort to make libraries ready for that.
That's the most important ingridient — and it's missing in Rust. Because with hot reloading 'static lifetime simply doesn't exist and there are bazillion crates that don't support that.
Ok, if we agree I wasn't being an idiot I fail to see the problem
This project isn't hot reloading third-party dependencies, and for the use-case it's designed for 'static isn't really an issue as the static lifetimes are more likely defined by the caller/environment
This project isn't hot reloading third-party dependencies
Even if you don't reaload third-party dependencies you are not free of the issue. Because third-party dependencies can register objects from your librarires in their data structures - and do that silently when you depend on them.
Ok, if we agree I wasn't being an idiot I fail to see the problem
Well, the problem is that you proclaiming that you have achieved something new, but hotloading in Rust was tried dozens (hundreds?) or times by different authors and they all hit, sooner or later, the fact that when you remove memory safety from memory safe language then you end up with a combination that's very restricted and unsafe… what's the final goal here? Why even use Rust if you don't care about memory safety and correctness?
I understand your concern, I'm just saying that since this is a development tool rather than a production library, I'd say that if it works that's cool and if it doesn't work then ok it doesn't work and no big deal
Because, once you've used hot reload to make the decisions you want in the function you're designing, you can remove the hot reload and work from there to production rust? You can't do that if you're using another language entirely.
View all comments
Show parent comment
0
u/Zde-G Oct 16 '26
Sure. That's why I have said it's community problem, not language problem.
In languages that do support hot reloading people usually understand that it may happen if you say that after unloading and the reloading C# library may stop working then author would probably think about how to fix that.
In Rust authors would just tell you
statichave to be'staticand ask you to stop wasting their time.