Reload Rust code without app restarts. For faster feedback cycles.

Overview

hot-lib-reloader

Crates.io CI License

hot-lib-reloader is a development tool that allows you to reload functions of a running Rust program. This allows to do "live programming" where you modify code and immediately see the effects in your running program.

This is build around the libloading crate and will require you to put code you want to hot-reload inside a Rust library (dylib). For a detailed discussion about the idea and implementation see this blog post.

Table of contents:

Usage

To quicky generate a new project supporting hot-reload you can use a cargo generate template: cargo generate rksm/rust-hot-reload.

Prerequisites

macOS

On macOS the reloadable library needs to get codesigned. For this purpose, hot-lib-reloader will try to use the codesign binary that is part of the XCode command line tools. It is recommended to make sure those are installed.

Other platforms

It should work out of the box.

Example project setup

Assuming you use a workspace project with the following layout:

├── Cargo.toml
└── src
│   └── main.rs
└── lib
    ├── Cargo.toml
    └── src
        └── lib.rs

Executable

Setup the workspace with a root project named bin in ./Cargo.toml:

[workspace]
resolver = "2"
members = ["lib"]

[package]
name = "bin"
version = "0.1.0"
edition = "2021"

[dependencies]
hot-lib-reloader = "^0.6"
lib = { path = "lib" }

In ./src/main.rs define a sub-module using the [hot_lib_reloader_macro::hot_module] attribute macro which wraps the functions exported by the library:

// The value of `dylib = "..."` should be the library containing the hot-reloadable functions
// It should normally be the crate name of your sub-crate.
#[hot_lib_reloader::hot_module(dylib = "lib")]
mod hot_lib {
    // Reads public no_mangle functions from lib.rs and  generates hot-reloadable
    // wrapper functions with the same signature inside this module.
    // Note that this path relative to the project root (or absolute)
    hot_functions_from_file!("lib/src/lib.rs");

    // Because we generate functions with the exact same signatures,
    // we need to import types used
    pub use lib::State;
}

fn main() {
    let mut state = hot_lib::State { counter: 0 };
    // Running in a loop so you can modify the code and see the effects
    loop {
        hot_lib::step(&mut state);
        std::thread::sleep(std::time::Duration::from_secs(1));
    }
}

Library

The library should expose functions. It should set the crate type dylib in ./lib/Cargo.toml:

[package]
name = "lib"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["rlib", "dylib"]

The functions you want to be reloadable should be public and have the #[no_mangle] attribute. Note that you can define other function that are not supposed to change without no_mangle and you will be able to use those alongside the other functions.

pub struct State {
    pub counter: usize,
}

#[no_mangle]
pub fn step(state: &mut State) {
    state.counter += 1;
    println!("doing stuff in iteration {}", state.counter);
}

Running it

  1. Start compilation of the library: cargo watch -w lib -x 'build -p lib'
  2. In another terminal run the executable: cargo run

Now change for example the print statement in lib/lib.rs and see the effect on the runtime.

In addition, using a tool like cargo runcc is recommended. This allows to run both the lib build and the application in one go.

lib-reload events

LibReloadObserver

You can get notified about two kinds of events using the methods provided by [LibReloadObserver]:

  • wait_for_about_to_reload the watched library is about to be reloaded (but the old version is still loaded)
  • wait_for_reload a new version of the watched library was just reloaded

This is useful to run code before and / or after library updates. One use case is to serialize and then deserialize state another one is driving the application.

To continue with the example above, let's say instead of running the library function step every second we only want to re-run it when the library has changed. In order to do that, we first need to get hold of the LibReloadObserver. For that we can expose a function subscribe() that is annotated with the #[lib_change_subscription] (that attribute tells the hot_module macro to provide an implementation for it):

#[hot_lib_reloader::hot_module(dylib = "lib")]
mod hot_lib {
    /* code from above */

    // expose a type to subscribe to lib load events
    #[lib_change_subscription]
    pub fn subscribe() -> hot_lib_reloader::LibReloadObserver {}
}

And then the main function just waits for reloaded events:

fn main() {
    let mut state = hot_lib::State { counter: 0 };
    let lib_observer = hot_lib::subscribe();
    loop {
        hot_lib::step(&mut state);
        // blocks until lib was reloaded
        lib_observer.wait_for_reload();
    }
}

How to block reload to do serialization / deserialization is shown in the reload-events example.

was_updated flag

To just figure out if the library has changed, a simple test function can be exposed:

#[hot_lib_reloader::hot_module(dylib = "lib")]
mod hot_lib {
    /* ... */
    #[lib_updated]
    pub fn was_updated() -> bool {}
}

hot_lib::was_updated() will return true the first time it is called after the library was reloaded. It will then return false until another reload occurred.

Usage tips

Know the limitations

Reloading code from dynamic libraries comes with a number of caveats which are discussed in some detail here.

No signature changes

When the signature of a hot-reloadable function changes, the parameter and result types the executable expects differ from what the library provides. In that case you'll likely see a crash.

Type changes require some care

Types of structs and enums that are used in both the executable and library cannot be freely changed. If the layout of types differs you run into undefined behavior which will likely result in a crash.

See use serialization for a way around it.

Hot-reloadable functions cannot be generic

Since #[no_mangle] does not support generics, generic functions can't be named / found in the library.

Global state in reloadable code

If your hot-reload library contains global state (or depends on a library that does), you will need to re-initialize it after reload. This can be a problem with libraries that hide the global state from the user. If you need to use global state, keep it inside the executable and pass it into the reloadable functions if possible.

Use feature flags to switch between hot-reload and static code

See the reload-feature example for a complete project.

Cargo allows to specify optional dependencies and conditional compilation through feature flags. When you define a feature like this

[features]
default = []
reload = ["dep:hot-lib-reloader"]

[dependencies]
hot-lib-reloader = { version = "^0.6", optional = true }

and then conditionally use either the normal or the hot module in the code calling the reloadable functions you can seamlessly switch between a static and hot-reloadable version of your application:

#[cfg(feature = "reload")]
use hot_lib::*;
#[cfg(not(feature = "reload"))]
use lib::*;

#[cfg(feature = "reload")]
#[hot_lib_reloader::hot_module(dylib = "lib")]
mod hot_lib { /*...*/ }

To run the static version just use cargo run the hot reloadable variant with cargo run --features reload.

Disable #[no-mangle] in release mode

To not pay a penalty for exposing functions using #[no_mangle] in release mode where everything is statically compiled (see previous tip) and no functions need to be exported, you can use the no-mangle-if-debug attribute macro. It will conditionally disable name mangling, depending on wether you build release or debug mode.

Use serialization or generic values for changing types

If you want to iterate on state while developing you have the option to serialize it. If you use a generic value representation such as serde_json::Value, you don't need string or binary formats and typically don't even need to clone anything.

Here is an example where we crate a state container that has an inner serde_json::Value:

#[hot_lib_reloader::hot_module(dylib = "lib")]
mod hot_lib {
    pub use lib::State;
    hot_functions_from_file!("lib/src/lib.rs");
}

fn main() {
    let mut state = hot_lib::State {
        inner: serde_json::json!(null),
    };

    loop {
        state = hot_lib::step(state);
        std::thread::sleep(std::time::Duration::from_secs(1));
    }
}

In the library we are now able to change the value and type layout of InnerState as we wish:

#[derive(Debug)]
pub struct State {
    pub inner: serde_json::Value,
}

#[derive(serde::Deserialize, serde::Serialize)]
struct InnerState {}

#[no_mangle]
pub fn step(state: State) -> State {
    let inner: InnerState = serde_json::from_value(state.inner).unwrap_or(InnerState {});

    // You can modify the InnerState layout freely and state.inner value here freely!

    State {
        inner: serde_json::to_value(inner).unwrap(),
    }
}

Alternatively you can also do the serialization just before the lib is to be reloaded and deserialize immediately thereafter. This is shown in the reload-events example.

Use a hot-reload friendly app structure

Whether or not hot-reload is easy to use depends on how you architect your app. In particular, the "functional core, imparative shell" pattern makes it easy to split state and behavior and works well with hot-lib-reloader

For example, for a simple game where you have the main loop in your control, setting up the outer state in the main function and then passing it into a fn update(state: &mut State) and a fn render(state: &State) is a straightforward way to get two hot-reloadable functions.

But even when using a framework that takes control, chances are that there are ways to have it call hot-reloadable code. The bevy example where system functions can be made hot-reloadable, shows how this can work.

You can also wait for lib changes and run code afterwards. This is useful if you want to iterate over a program that only produces output once, for example work on a data analysis or visualization. This snippet shows how:

#[hot_module(dylib = "lib")]
mod hot_lib {
    /*...*/
    #[lib_change_subscription]
    pub fn lib_reload_rx() -> mpsc::Receiver<ChangedEvent> {}
}

loop {
    hot_lib::step();
    // waits for a lib reload:
    let event = rx.recv()?;
}

Adjust the file watch debounce duration

The hot_module macro allows setting the file_watch_debounce attribute which defines the debounce duration for file changes in milliseconds. This is 500ms by default. If you see multiple updates triggered for one recompile (can happen the library is very large), increase that value. You can try to decrease it for faster reloads. With small libraries / fast hardware 50ms or 20ms should work fine.

#[hot_module(dylib = "lib", file_watch_debounce = 50)]
/* ... */

Debugging

If your hot_module gives you a strange compilation error, try cargo expand to see what code is generated.

By default the hot-lib-reloader crate won't write to stdout or stderr but it logs what it does with info, debug, and trace log levels using the log crate. Depending on what logging framework you use (e.g. env_logger), you can enable those logs by setting a RUST_LOG filter like RUST_LOG=hot_lib_reloader=trace.

Examples

Examples can be found at rksm/hot-lib-reloader-rs/examples.

  • minimal: Bare-bones setup.
  • reload-feature: Use a feature to switch between dynamic and static version.
  • serialized-state: Shows an option to allow to modify types and state freely.
  • reload-events: How to block reload to do serialization / deserialization.
  • all-options: All options the hot_module macro accepts.
  • bevy: Shows how to hot-reload bevy systems.
  • nannou: Interactive generative art with nannou.
  • egui: How to hot-reload a native egui / eframe app.
  • iced: How to hot-reload an iced app.

Known issues

tracing crate

When used with the tracing crate multiple issues can occur:

  • When tracing is used in the library that is reloaded the app sometimes crashes with Attempted to register a DefaultCallsite that already exists!
  • When used in combination with bevy, commands.insert(component) operations stop to work after a reload, likely because of internal state getting messed up.

If you can, don't use hot-lib-reloader in combination with tracing.

License

MIT

License: MIT

Comments
  • Setting an absolute path to the lib dir.

    Setting an absolute path to the lib dir.

    Unfortunately I have to change the working directory of the application which I was trying this on and found that the reloader blows up because it is assuming the target is relative to current working directory. The initial thought was to do something based on env! and/or related items but I don't believe I can get those passed into the proc-macro attributes properly. (Or I just suck with that bit of meta-programming, very possible.. :) ) So, I was wondering if it would be viable to do something which delays the reloader setup till entry into main such that I could then tell it, at runtime, use xyz path as the root path rather than assuming things are relative.

    If I could set it in main, then I can use the env! macro and fiddle the compile time result to point to the correct place, i.e. a rooted path from the manifest directory down to the containing workspace directory where the 'target' folder lives. Or, I'd love a pointer on how to build that path such that the proc macro attribute would accept it correctly. I.e. I need: env!("CARGO_MANIFEST_DIR") + "/../../" to get the correct base path. But, of course that could change if I'm using the lib as a pulled crate rather than a part of the larger project (which is an eventual desire).

    Thoughts and suggestions very welcome.

    opened by All8Up 3
  • Documentation does not mention that hot reloader only checks for reload if you call a function (at least once?)

    Documentation does not mention that hot reloader only checks for reload if you call a function (at least once?)

    While retrofiring my project to use hot-lib-reloader-rs I ran into a very confusing issue, the notification from wait_for_about_to_reload never came back to me. I spent 2 hours comparing my project to the sample, refactoring, debugging, etc.

    It turns out that if you don't call into any function in your hot reload API consistently (or at least once?) you don't get any notification.

    My use case involves waiting for a reload, and then doing a bunch of work. I was not calling any API before the notification.

    Once I created an empty API that I called in my message loop everything started working.

    I'm filing this to suggest a documentation change to explain how\when the listening occurs.

    opened by chamons 3
  • Windows sometimes doesn't work

    Windows sometimes doesn't work

    All the examples provided work except the bevy one,

    LINK : fatal error LNK1104: can't open file '.\hot-lib-reloader-rs\examples\bevy\target\debug\deps\systems.dll
    
    opened by cdecompilador 2
  • `hot_functions_from_file` doesn't find functions created in a macro

    `hot_functions_from_file` doesn't find functions created in a macro

    I'm trying to hide some of the moving parts by creating the exported, no_mangle'd functions in a macro (exposed from a library) but when I attempt to use it in my reloadable lib, the hot_functions_from_file function doesn't find them.

    // mod file1
    #[macro_export]
    macro_rules! make_exports {
      #[no_mangle]
      pub fn f() -> i32 { 42 }
    }
    
    // mod file2
    make_exports!();
    
    // main
    mod hot_lib {
      hot_functions_from_file("file2/src/lib.rs");
    }
    
    fn main() {
      hot_lib::f(); // function not found in `hot_lib`
    }
    
    opened by jjant 1
  • [Feature request] Only reload on request

    [Feature request] Only reload on request

    I'm writing a sort of game engine and I would like to be able to only reload game code on request (say, when a user presses Cmd+R). Is this currently possible with the library? I couldn't figure it out.

    Thanks!

    opened by jjant 1
  • no_mangle attribute in production systems

    no_mangle attribute in production systems

    If I understood correctly, the HotModule will parse and expose as hot-reloadable all public no_mangle functions, but I was wondering if marking systems functions as #[no_mangle] may impact production performance, since AFAIK Rust compiler won't be able to fully otimize those functions.

    It's possible somehow to only mark #[no_mangle] on hot-reload builds?

    opened by afonsolage 1
  • My own approach to hot-reloading.

    My own approach to hot-reloading.

    By coincidence I made my own hot-reloading test just a few weeks ago when I read fasterthanli's article However I find that, my setup. Is a tad bit less of a hassle to set-up. I also watch for file changes & use libloading. However I use: cargo-watch -x "build -Z unstable-options --out-dir ./plugins" Then simply watch the directory for Event::Write events.

    I only need to specify the plugin directory, which I find less of a hassle to write compared to

    hot_lib_reloader::define_lib_reloader! {
        unsafe MyLibLoader {
            lib_name: "lib",
            source_files: ["path/to/lib.rs"]
        }
    }
    

    For each library.

    However you need to check the function signature in the source file, and must therefore know the source location. Except the source location embedded in the library if it's a debug build so you may extract it from there. I'm sure there's a library that can extract it easily, but I wouldn't the name on top of my head. (maybe symbolic-debuginfo?)

    If you're interested, here's my main method for my reload test. ( Probably adopted from fasterthanli, I can't remember )

    use std::{error::Error, path::Path};
    
    // use hotwatch::{Event, Hotwatch}; // Non blocking
    use hotwatch::blocking::Hotwatch;   //     Blocking
    use libloading::{Library, Symbol};
    
    static PLUGINS_LIBRARY_PATH: &str = "."; // Relative to the process' current working directory
    fn main() -> Result<(), Box<dyn Error>> {
        let mut hotwatch = Hotwatch::new().expect("hotwatch failed to initialize!");
    
        hotwatch.watch(PLUGINS_LIBRARY_PATH, |event| {
            if let hotwatch::Event::Write(path) = event {
                if path.extension() == Some("so".as_ref()) {load_and_print(&path).expect("Error loading so file.");}
            }
    
            hotwatch::blocking::Flow::Continue
        })?;
        hotwatch.run();
        Ok(())
    }
    
    fn load_and_print(path: &Path) -> Result<(), libloading::Error> {
        unsafe {
            let lib = Library::new(path)?;
            let greet: Symbol<unsafe extern "C" fn(name: String)> = lib.get(b"greet")?;
            greet("reloading".to_string());
        }
    
        Ok(())
    }
    
    opened by codecnotsupported 1
  • Spurious crashes when reloading on macos: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))

    Spurious crashes when reloading on macos: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))

    On macos the application crashes after some reloads with EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid)).

    This is a known issue see for example:

    • https://developer.apple.com/forums/thread/696460
    • https://developer.apple.com/documentation/security/updating_mac_software

    In order to deal with this we need to make sure the copied dylibs get codesigned.

    opened by rksm 0
  • Changing how Rust source files are found for v0.6

    Changing how Rust source files are found for v0.6

    The hot_module attribute macro (via hot_functions_from_file!("path/to/file.rs")) and the define_lib_reloader!(...) macro allow specifying Rust source files from which public #[no_mangle] functions are discovered and for which hot-reloadable proxy functions are created.

    So far, both macros expected file relative paths, i.e. paths relative to the file where the macro was defined. So, for example:

    ├── Cargo.toml
    └── src
    │   └── main.rs    <- hot_functions_from_file!("../lib/src/lib.rs");
    └── lib
        ├── Cargo.toml
        └── src
            └── lib.rs 
    

    Code for this is here: https://github.com/rksm/hot-lib-reloader-rs/blob/cb016a03c68ea2fb2176b683ff466d8bdb8f94e0/macro/src/util.rs

    The reasoning behind it was that it might be more intuitive and easier to reason about with larger code bases but there are two problems that requiring a relative path created:

    1. We need Rust nightly to use the proc_macro::Span feature to lookup the path of the file in which the macro was declared
    2. rust-analyzer fails to expand the macro and cannot give code completion

    Thinking about it again, requiring that the path of the files to be relative to the project root is not so bad and will solve both of the problems above. But it means that we need to break the interface. For this reason this change requires a version bump to v0.6.

    So` instead of the above, the following will be expected:

    ├── Cargo.toml
    └── src
    │   └── main.rs    <- hot_functions_from_file!("lib/src/lib.rs");
    └── lib
        ├── Cargo.toml
        └── src
            └── lib.rs 
    
    opened by rksm 0
  • fix how we lock the lib loader

    fix how we lock the lib loader

    I used a convoluted half-baked incorrect ref counting scheme for access to symbols while not needing to mutex lock the lib loader during a call (so that recursive calls work)

    This is much better addressed with a RwLock that.

    This cleans up both the __lib_loader() and __lib_notifier() accessors. It should also fix spurious crashes during hot updates that were likely caused by symbols actually being used (b/c the prev solution wasn't really thread safe).

    opened by rksm 0
  • Register for lib change events

    Register for lib change events

    Added support for getting lib reload events. Inside a hot_module, the following creates a function that can be used to subscribe:

    #[lib_change_subscription]
    pub fn subscribe() -> std::sync::mpsc::Receiver<hot_lib_reloader::ChangedEvent> {}
    
    opened by rksm 0
  • `Iced` sample code keeps crashing at every `lib` reload

    `Iced` sample code keeps crashing at every `lib` reload

    I've been experimenting with the following Iced sample code, but it keeps crashing at every lib reload. I can't figure out if I'm mistaking something or if it's due to a hot-lib-reloader-rs' issue, can you please help me out?

    I tested the attached code both on Windows 10 and Arch Linux, with rustc version 1.65.0 and 1.67.0-nightly, and I attempted also using cargo run --features iced/glow with no luck.

    commands:
      bin: |
        cargo run
      lib: |
          cargo watch -w lib -x 'build -p lib'
    

    bin

    [workspace]
    members = ["lib"]
    
    [package]
    name = "bin"
    version = "0.1.0"
    edition = "2021"
    
    [dependencies]
    hot-lib-reloader = "0.6.4"
    iced = "0.5.2"
    lib = { path = "lib" }
    
    #[hot_lib_reloader::hot_module(dylib = "lib")]
    mod hot_lib {
        use iced::{Element, Theme};
        pub use lib::*;
        hot_functions_from_file!("lib/src/lib.rs");
    }
    
    use hot_lib::*;
    use iced::{Element, Sandbox, Settings, Theme};
    
    fn main() -> iced::Result {
        App::run(Settings::default())
    }
    
    #[derive(Debug, Default)]
    struct App {
        state: State,
    }
    
    impl Sandbox for App {
        type Message = Message;
    
        fn new() -> Self {
            Self::default()
        }
    
        fn title(&self) -> String {
            title()
        }
    
        fn update(&mut self, message: Message) {
            update(&mut self.state, message)
        }
    
        fn view(&self) -> Element<Message> {
            view(&self.state)
        }
    
        fn theme(&self) -> Theme {
            theme(&self.state)
        }
    }
    

    lib

    [package]
    name = "lib"
    version = "0.1.0"
    edition = "2021"
    
    [lib]
    crate-type = ["rlib", "dylib"]
    
    [dependencies]
    iced = "0.5.2"
    
    use iced::widget::{
        button, column, horizontal_rule, horizontal_space, radio, row, text, vertical_space,
    };
    use iced::{Alignment, Element, Length, Theme};
    
    #[derive(Debug)]
    pub struct State {
        text_size: u16,
        theme: Theme,
    }
    
    impl Default for State {
        fn default() -> Self {
            Self {
                text_size: 100,
                theme: Theme::default(),
            }
        }
    }
    
    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
    pub enum ThemeType {
        Light,
        Dark,
    }
    
    #[derive(Debug, Clone)]
    pub enum Message {
        ThemeChanged(ThemeType),
        IncrementTextSizePressed,
        DecrementTextSizePressed,
    }
    
    #[no_mangle]
    pub fn title() -> String {
        String::from("Hello World - HotIce")
    }
    
    #[no_mangle]
    pub fn update(state: &mut State, message: Message) {
        let size_change = 10;
        match message {
            Message::ThemeChanged(theme) => {
                state.theme = match theme {
                    ThemeType::Light => Theme::Light,
                    ThemeType::Dark => Theme::Dark,
                }
            }
            Message::IncrementTextSizePressed => {
                if state.text_size <= 200 - size_change {
                    state.text_size += size_change;
                }
            }
            Message::DecrementTextSizePressed => {
                if state.text_size >= size_change {
                    state.text_size -= size_change;
                }
            }
        }
    }
    
    #[no_mangle]
    pub fn view(state: &State) -> Element<Message> {
        let choose_theme = [ThemeType::Light, ThemeType::Dark].into_iter().fold(
            column![text("Choose a theme:")].spacing(10),
            |column, theme| {
                column.push(radio(
                    format!("{:?}", theme),
                    theme,
                    Some(match state.theme {
                        Theme::Light => ThemeType::Light,
                        Theme::Dark => ThemeType::Dark,
                        Theme::Custom { .. } => panic!(),
                    }),
                    Message::ThemeChanged,
                ))
            },
        );
    
        column![
            row![choose_theme, horizontal_space(Length::Fill)],
            horizontal_rule(20),
            vertical_space(Length::Fill),
            text("zHello, world!").size(state.text_size),
            vertical_space(Length::Fill),
            row![
                button("Increment Text Size").on_press(Message::IncrementTextSizePressed),
                button("Decrement Text Size").on_press(Message::DecrementTextSizePressed),
            ]
            .spacing(20)
        ]
        .spacing(20)
        .padding(20)
        .align_items(Alignment::Center)
        .into()
    }
    
    #[no_mangle]
    pub fn theme(state: &State) -> Theme {
        state.theme.clone()
    }
    
    opened by lucatrv 3
  • Including functions from multiple files is a bit tedious

    Including functions from multiple files is a bit tedious

    The hot_functions_from_file! macro is very helpful, but it only works on single files (which most non-trivial projects grow out of quite quickly). If a user wants to break up their project into multiple files for manageability, their options are:

    • Redefine the hot-reloaded library's whole API either in a single file for hot_functions_from_file! to pick up or directly in the hot_module
    • Multiple calls to hot_functions_from_file! for every file in the project

    Both of these things are rather clumsy and would be unnecessary if hot_functions_from_file! didn't only work on single files. I took a look at the package source to see if there's any technical limitation preventing the macro from working on folders too but as far as I can tell, the only thing is that if a user uses the ignore_no_mangle option there is the possibility of duplicate function names in different files.

    Proposal

    Provide a new hot_functions_from_folder! or hot_functions_from_crate! macro that recursively pulls public no-mangled function definitions from a provided folder or crate path. Unlike hot_functions_from_file! it will not take an ignore_no_mangle argument, so that the function names/symbols are known to be unique.

    I don't mind implementing it myself if you're good with this but that would have to be over the weekend.

    opened by filleduchaos 0
  • segmentation fault

    segmentation fault

    I was trying to use this library for a project that uses syscalls, libc, nix etc (e.g. shared memory, mutex). also, tokio async and unsafe are used across my project. It threw segmentation fault with hot reloading. i am looking some guidance on suitability of using this library.

    opened by GOVYANSONG 4
  • Support for reloading impl methods

    Support for reloading impl methods

    Currently impl methods are not supported, only plain functions. impl methods can be declared as no mangle as well so there is no reason to not support them. This will require some thinking about invocation: method(&self, arg) will work but self.method(arg) not without some work...

    opened by rksm 0
  • Segmentation Fault on changing function params

    Segmentation Fault on changing function params

    Running on Ubuntu 20.04

    When testing out the bevy example, if I add commands to the parameters for player_movement_system then the application seg faults. This happens for any change to the system params I have tested. This may be a fundamental limitation with these techniques though.

    opened by mwbryant 2
Owner
Robert Krahn
Staff Software Engineer at Datadog
Robert Krahn
A simplified but faster version of Routerify

Routerify lite Routerify-lite is a simplified but faster version of Routerify. It only provides below functions: path matching error handling Why not

jinhua luo 7 Dec 30, 2022
A tool to run web applications on AWS Lambda without changing code.

AWS Lambda Adapter A tool to run web applications on AWS Lambda without changing code. How does it work? AWS Lambda Adapter supports AWS Lambda functi

AWS Samples 321 Jan 2, 2023
messloc is a drop in replacement for malloc that can transparently recover from memory fragmentation without any changes to application code.

messloc is a drop in replacement for malloc that can transparently recover from memory fragmentation without any changes to application code. Goals Al

null 11 Dec 10, 2022
The lambda-chaos-extension allows you to inject faults into Lambda functions without modifying the function code.

Chaos Extension - Seamless, Universal & Lightning-Fast The lambda-chaos-extension allows you to inject faults into Lambda functions without modifying

AWS CLI Tools 5 Aug 2, 2023
Extracting react native app source code from apk file.

extract-myreact Extracting React Native app source code from apk file.

Aan 3 Oct 5, 2022
A simple *blazingly fast* Rust library to unzip an S3 archive without downloading.

S3-unzip A simple blazingly fast Rust library to unzip an S3 archive into S3's root directory. Works without downloading the archive or putting it int

Mykhailo Bondarenko 9 Jul 12, 2022
A Rust framework to develop and use plugins within your project, without worrying about the low-level details.

VPlugin: A plugin framework for Rust. Website | Issues | Documentation VPlugin is a Rust framework to develop and use plugins on applications and libr

VPlugin 11 Dec 31, 2022
hado-rshado — A little macro for writing haskell-like do expressions without too much ceremony

hado Monadic haskell-like expressions brought to rust via the hado! macro What? A little macro for writing haskell-like do expressions without too muc

Lucas David Traverso 44 Jul 31, 2022
A framework for iterating over collections of types implementing a trait without virtual dispatch

zero_v Zero_V is an experiment in defining behavior over collections of objects implementing some trait without dynamic polymorphism.

null 13 Jul 28, 2022
Add nice user-facing diagnostics to your errors without being weird about it.

thisdiagnostic is a Rust library for adding rich diagnostic metadata to errors, for some really fancy and customizable error reporting!

Kat Marchán 14 Feb 2, 2022
tri-angle trader without trade, just watch pair's price change, print arbtrage chance.

tri-angle trader without trade, just watch pair's price change, print arbtrage chance.

铁哥 5 Nov 19, 2022
You can name anonymous Future from async fn without dyn or Box!

rename-future You can name anonymous Future from async fn without dyn or Box! PLEASE READ THIS THIS PROJECT NOT YET WELL TESTED! DON'T USE THIS IN PRO

Jun Ryung Ju 54 Sep 17, 2022
An iterator adapter to peek at future elements without advancing the cursor of the underlying iterator.

multipeek An iterator adapter to peek at future elements without advancing the cursor of the underlying iterator. Check out the documentation for more

Luca Palmieri 20 Jul 16, 2022
Build your service-server fast, easy (and without hosting!)

service-io is a library to build servers that offering services with really little effort. Choose an input connector. Choose an output connector. Choo

Luis Enrique Muñoz Martín 34 Jan 4, 2023
Peekable iterator that allows to peek the next N elements without consuming them.

peekaboo docs - crates.io Peekable iterator that allows to peek the next N elements without consuming them. It's no_std compatible by default. It also

annie 6 Nov 27, 2022
Fusion is a cross-platform App Dev ToolKit build on Rust . Fusion lets you create Beautiful and Fast apps for mobile and desktop platform.

Fusion is a cross-platform App Dev ToolKit build on Rust . Fusion lets you create Beautiful and Fast apps for mobile and desktop platform.

Fusion 1 Oct 19, 2021
How to use libtor in a Rust app

libtor example Uses libtor crate to run a Tor daemon in process. This example spawns the Tor daemon using Tokio's spawn_blocking, and then spawns othe

Byron Hambly 1 Nov 28, 2021
A Rust library that implements the main lightning logic of the lipa wallet app.

lipa-lightning-lib (3L) Warning This library is not production ready yet. Build Test Start Nigiri Bitcoin: nigiri start --ln The --ln flag is not stri

lipa 9 Dec 15, 2022
An example app in Rust for CircleCI's Dynamic Config demo

circleci-dynamic-config-example An example app in Rust for CircleCI's dynamic config demo. Dynamic config allows you to dynamically generate CircleCI'

yujiosaka 2 Oct 6, 2022