Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared library for hot reload #757

Open
namse opened this issue Jan 2, 2024 · 2 comments
Open

Shared library for hot reload #757

namse opened this issue Jan 2, 2024 · 2 comments
Labels
namui This issue is for namui engine

Comments

@namse
Copy link
Contributor

namse commented Jan 2, 2024

To achieve hot reload, user's code should be shared library(or wasm), which we can load/unload during execution.

For example,

  1. the runtime which runs user code and links that to heavy, unchanging libraries.
  2. user code which compiled to shared library to load/unload during execution
  3. the heavy, unchanging libraries during editing user code
  • for example, namui or ffmpeg etc

So, runtime keep memory state even on reload user code. we can refresh small amount of component which the type of state or props changed.

What we need to research is

  1. the detailed architecture
  2. how to reduce the size and compile time of shared library from user code
  3. how to link between user code and heavy libraries
@namse namse added the namui This issue is for namui engine label Jan 2, 2024
@namse
Copy link
Contributor Author

namse commented Jan 2, 2024

prototype example https://github.com/namse/rust-plugin-example

using function pointer setting.

extern "Rust" with dylib seems not working. So I decided to use function pointer setting.

@namse
Copy link
Contributor Author

namse commented Jan 3, 2024

I think hot reload is very dangerous depending on what kind of state user will save in hooks system.

Some topics we have to research,

  1. Arc
  2. Determining the type(and it's field) has been updated or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
namui This issue is for namui engine
Projects
None yet
Development

No branches or pull requests

1 participant