logoalt Hacker News

majketoday at 6:40 AM2 repliesview on HN

About structs:

https://docs.rs/subsecond/0.7.0-alpha.1/subsecond/index.html...

  "In practice, frameworks that implement subsecond patching properly will throw out the old state and thus you should never witness a segfault due to misalignment or size changes. Frameworks are encouraged to aggressively dispose of old state that might cause size and alignment changes."
I don't think "throwing out the old state" is a sensible recommendation. "re-instancing" is called "update/upgrade/downgede of internal state" in OTP:

https://www.erlang.org/docs/24/man/gen_server#Module:code_ch...

Perhaps I'm missing something, maybe subsecond is a good tool for toy apps or for a developer workflow. But for anything serious, I'd think that managing layout of structs is a primary concern.


Replies

jkelleyrtptoday at 7:12 AM

It’s a developer tool to speed up rust iteration, not a production tool like erlang.

That being said, bevy is using bevy-reflect to implement proper struct hot-reloading between hot-patches.

conradludgatetoday at 7:34 AM

> Subsecond is only enabled when debug_assertions are enabled so you can safely ship your application with Subsecond enabled without worrying about the performance overhead.

debug_assertions is usually only enabled in the development phase (release build default to debug_assertions=false), so yes this is not intended for production workloads