rvscript icon indicating copy to clipboard operation
rvscript copied to clipboard

is hot reload possible?

Open longzhiri opened this issue 1 year ago • 1 comments

Hello! If I have a rather large script project, and I want to hot reload a single script file, just like reloading a module in Lua, is that possible?

longzhiri avatar May 27 '24 13:05 longzhiri

For example in this repository, if you change a single script file, only that file will be recompiled when you build. All my build scripts use incremental compilation. I also use ccache in order to reduce build times even further. The result is that the iteration speed is quite fast, despite having to build a program after each change.

I don't know if it can compete with a Lua hot-reload. But it would be possible to detect a source change and rebuild the RISC-V binary in the background with a simple shell script that uses inotify. Example: https://gist.github.com/mpapi/4656389

As an example, Godot will use this on every resource: If the resource changes, reload it. Initializing the VM with a new program is fast enough that it is nearly instant.

fwsGonzo avatar May 30 '24 19:05 fwsGonzo