Inky-developer / debris

A powerful datapack generator for minecraft
https://inky-developer.github.io/debris/debris_lang/
MIT License
15 stars 0 forks source link

Hot reloading #3

Open Plecra opened 3 years ago

Plecra commented 3 years ago

I think this would have to be a bukkit plugin which could communicate with the compiler to switch out the datapacks as edits are made.

Datapacks are a great target for hot reloading, since minecraft is full of state. What do you think of designing the language to support it from the start?

Inky-developer commented 3 years ago

I think hot reloading functionality is a very crucial part for this language. Thankfully, Minecraft supports a remote control natively (if enabled in server.properties). This allows to send a reload command every time when the user changes the script. Since no program state changes when the datapack reloads, the program could even continue right at where it was before reloading.

Plecra commented 3 years ago

I haven't done much work with hot-reloading but AIUI, it can be much more powerful with explicit support from the language. Many functions take place over multiple ticks, and it'll be important to let them clean themselves up if we want the hot reloading to be reliable.

Mun might be a good reference

Inky-developer commented 3 years ago

That seems a very ambitious. I think the ability to transfer old data (eg. transfer the old struct of (int, int) to (int, int, bool) without having to restart the datapack) is out of scope, maybe a long term goal.