logoalt Hacker News

jkelleyrtpyesterday at 10:03 PM5 repliesview on HN

Creator here - haven't had a chance to write up a blog post yet! Stay tuned.

The gist of it is that we intercept the Rust linking phase and then drive `rustc` manually. There's some diffing logic that compares assembly between compiles and then a linking phase where we patch symbols against the running process. Works across macOS, Windows, Linux, iOS, Android, and WASM. On my m4 I can get 130ms compile-patch times, quite wicked stuff.

We handle the hard parts that the traditional dylib-reloading doesn't including TLS, statics, constructors, etc.

I've been posting demos of it to our twitter page (yes twitter, sorry...)

- With bevy: https://x.com/dioxuslabs/status/1924762773734511035

- On iOS: https://x.com/dioxuslabs/status/1920184030173278608

- Frontend + backend (axum): https://x.com/dioxuslabs/status/1913353712552251860

- Ratatui (tui apps): https://x.com/dioxuslabs/status/1899539430173786505

Our unfinished release notes are here:

https://github.com/DioxusLabs/dioxus/releases/tag/v0.7.0-alp...

More details to come!


Replies

bjackmantoday at 7:52 AM

[How] do you track when it's safe to delete the old version of a patched piece of code?

Edit: or, I guess since this doesn't seem to be something intended for use in prod, maybe that's not necessary. You can just bloat the runtime process more or less indefinitely.

I was curious because IIUC Linux kernel livepatches handle this via something related to RCU, which I guess is not possible in this context.

sureglymoptoday at 6:54 AM

The axum example looks amazingly useful! Very cool project and idea.

1oooqooqtoday at 12:08 AM

can't access the xitter posts... is the axum part using the whole of dioxus or bare axum + code reloading?

show 1 reply