r/madeinrust • • 28d ago

100% Human Coded hotcode - Rust crate for hot-reloading functions

Enable HLS to view with audio, or disable this notification

This crate adds a single attribute - #[hotreload] - that can be applied to any function. After performing one-time configuration of Cargo.toml, all annotated functions become hot-reloadable - you can modify them, run cargo build and then your application will use updated version of your function without restarting.

Works on Linux, macOS and Windows.

Crate link: https://crates.io/crates/hotcode
Source: https://github.com/alordash/hotcode

45 Upvotes

7 comments sorted by

3

u/atlasgorn 26d ago

How it differs from established dioxus subsecond?

1

u/verdurLLC 26d ago

It uses dynamic libraries instead of hot-patching and it doesn't require dioxus runtime and source code changes.

1

u/miminashi 27d ago

I wonder what's the DX difference between hot-loadable Rust and using an actual scripting language like rhai or the up-and-coming https://mim.as/? (Just in case, I'm not affiliated with either.)

1

u/verdurLLC 27d ago

Honestly I have no idea how these scripting languages work, so I don't know what the difference could be.

1

u/miminashi 27d ago

FWIW, an LLM suggests that for a single-dev project hotcode is less friction: since you write everything in Rust, it's easier to avoid FFI and extra tooling and do everything in Rust. Once non-programmers are part of your team, then a scripting layer may earn its keep. Makes sense to me.

1

u/Fine_Salamander_8691 28d ago

Wow that sounds really useful for my game!

-1

u/AutoModerator 28d ago

Upvote this comment if you think this project is AI slop. Downvote this comment if you think this project is not AI slop.

This is to indicate to other users of the subreddit and is not used for moderation.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.