Simple and performant hot-reloading for Rust

Overview

reloady

Simple, performant hot-reloading for Rust.

Requires Rust nightly and only works on Linux for now.

installing CLI

To install the CLI helper cargo hot-reload:

cargo install --path cargo-hot-reload

running examples

To run an example, run cargo hot-reload inside its directory.

Note: initial builds may take a while to complete at first, but will be fast afterwards.

Reloady's performance goal is to hot-reload in under 2 seconds, which it currently achieves.

usage

First, add the dependency to your Cargo.toml (reloady is not published on crates.io yet):

[dependencies]
reloady = { path = "../../reloady" }

Next, add the following features to the top of your lib.rs or main.rs:

#![feature(link_args)]
#![feature(linkage)]

Lastly, annotate any function you would like to hot-reload with the attribute:

#[reloady::hot_reload]
fn hot_reload_me() {
    /* ... */
}

And hot reload your code with:

$ cargo hot-reload

Note that functions are only reloaded when they are called, so reloady works best when it is annotating a function that is called in a loop. For more information on this, see examples.

features

  • hot reloads in <2s
  • zero-cost when not hot-reloading (compiled out entirely!)
  • (coming soon) hot reloading structs/state
You might also like...
🚀simple server that returns error codes with their respective messages and debug information, written in rust 🦀
🚀simple server that returns error codes with their respective messages and debug information, written in rust 🦀

ErrorServer 🚀 A simple & lightweight server that returns a HTML page of the error code with its respective message and debug information, written in

Simple, automatic, and customizable tree pretty-printing in Rust.
Simple, automatic, and customizable tree pretty-printing in Rust.

display_tree Simple, automatic, and customizable tree pretty-printing in Rust. This crate provides tools to easily pretty-print data as a tree, includ

Simple and customizable procedural noise generation library written in Rust.
Simple and customizable procedural noise generation library written in Rust.

libnoise A simple, performant, and customizable procedural noise generation library inspired by libnoise for C++ featuring: Easy coherent noise genera

A typesafe, flexible, simple, and user-friendly unit system library for Rust that has good error messages.

uy A typesafe, flexible, simple, and user-friendly unit system library for Rust that has good error messages. Usage uy not only stores the unit of a v

A simple and convenient way to bundle owned data with a borrowing type.

A simple and convenient way to bundle owned data with a borrowing type. The Problem One of the main selling points of Rust is its borrow checker, whic

A simple heads or tails (cross and pile) on Solana

cross-pile (Coin flip) A heads or tails (cross and pile) on Solana. It's meant to serve as an example of how to use solrand, a randomness Oracle: http

A Simple Audio Control and Notifications Daemon

SACAND This is sacand, a Simple Audio Control and Notifications Daemon As it name oaths to imply, this is intended to be a simple audio control daemon

Simple string matching with questionmark- and star-wildcard operator

wildmatch Match strings against a simple wildcard pattern. Tests a wildcard pattern p against an input string s. Returns true only when p matches the

A simple library to get all pairs from any Dex and sync reserves.

pair_sync A simple library to get all pairs from any supported Dex and sync reserves. Crates.io Documentation in progress Filename: examples/sync-pair

Comments
  • The link_args attribute has been removed

    The link_args attribute has been removed

    See https://github.com/rust-lang/cargo/pull/9557.

    A temporary fix I found was to remove all references to it in the source code and add a build script that prints cargo:rustc-link-arg=-export-dynamic to my app (I'm on Linux).

    Could it perhaps be possible to export a helper for users to put in their build scripts that prints the correct cargo:rustc-link-arg directive for their platform and selected feature set?

    Or is this only needed for the reloady library and not for the actual projects that use it?
    Because in that case I feel like the fix would be easier.

    opened by ohmree 6
Releases(v0.1.0)
Owner
Anirudh Balaji
I like to write useful code.
Anirudh Balaji
A minimal boilerplate for Astro / Vite with the Nannou creative framework (Rust → WASM). Supports multiple sketches + hot-reload.

Astro x Nannou Starter astro-nannou-demo-1c.mov ?? Try it online! # 0a. Rust language tools open https://www.rust-lang.org/tools/install # 0b. wasm-p

Julian Cataldo 4 Jan 4, 2023
Mote is a systems-programming language designed to be practical, performant, and simple.

Mote NOTE: this following lists the goals for what Mote is supposed to be. It does not promise that any of the features here will be accomplished or a

The Mote Programming Language 14 Jul 28, 2021
Rust-idiomatic, compliant, flexible and performant BIP21 crate

Rust implementation of BIP21 Rust-idiomatic, compliant, flexible and performant BIP21 crate. About Important: while lot of work went into polishing th

Martin Habovštiak 6 Dec 15, 2022
A highly performant HTTP bittorrent tracker (WIP)

kiryuu Rewrite of kouko in Rust, for better performance! Kiryuu powers http://tracker.mywaifu.best:6969/announce Thanks Many thanks to horsie and anon

Raghu Saxena 6 Dec 15, 2022
Fast and simple datetime, date, time and duration parsing for rust.

speedate Fast and simple datetime, date, time and duration parsing for rust. speedate is a lax† RFC 3339 date and time parser, in other words, it pars

Samuel Colvin 43 Nov 25, 2022
TypeRust - simple Rust playground where you can build or run your Rust code and share it with others

Rust playground Welcome to TypeRust! This is a simple Rust playground where you can build or run your Rust code and share it with others. There are a

Kirill Vasiltsov 28 Dec 12, 2022
A simple programming language for something between C and Rust.

inuc inuc is a systems programming language that is something between C and Rust. Features : [] Strong , static typing (type inference not a priority

Sagnik Chatterjee 1 Feb 7, 2022
Rust language from simple to deep, and then to strengthen learning in multiple module

Rust Library This project is used to learn rust language from simple to deep, and then to strengthen learning in multiple module. It is used to help n

Summer 1 Sep 19, 2022
A simple thread schedule and priority library for rust

thread-priority A simple library to control thread schedule policies and thread priority. If your operating system isn't yet supported, please, create

Victor Polevoy 62 Dec 5, 2022
A relatively simple puzzle generator application written in Rust and used via Javascript

Puzzlip Basic Overview This is a relatively simple puzzle generator application written in Rust and used via Javascript in https://puzzlip.com. If you

Nenad 5 Dec 7, 2022