warmreload

warmreload

a norns mod to automatically reload scripts during development.

when enabled, this mod will reload a script anytime there is a change in the code directory. this is useful for fast prototyping and development.

installation

;install https://github.com/schollz/warmreload

to activate, go to SYSTEM > MODS then select warmreload and turn E2 until you see a + sign. then restart your norns. now anytime you save a script it will reload it.

note: the first time you run a script after enabling, the script will need an internet connection to download a 4.5 MB binary that enables the watch service.

also note: if you are running this on not-a-norns (e.g. norns desktop) then you can still use this script, but it needs to be compiled for your system which is likely not arm. assuming you have Golang installed:

os.execute("cd /home/we/dust/code/warmreload && go build -v")

(any norns user doesn’t need to do this, since the binary is already compiled for those norns shields and boxes).

acknowledgements

I’d like to acknowledge all the mighty inspiring participants of the habitus workshops - the topic of live reload came up often. I’ve had a solution for hot reloading while doing development but I’ve never shared it (mostly because it was sorta complicated), but all the discussions inspired me to push out a simple set-it-and-forget-it mod that accomplishes it.

51 Likes

Wow, this is amazing zack! Can‘t wait to try this out. It will definitely make dev work easier :slightly_smiling_face:

1 Like

Wow niceee DX¹ contribution!

There is the handy ⌘-P shortcut on Maiden, but I think it only works when in the main sourcecode file, the with init().

¹ Developer experience

3 Likes

cool! I did not know that :slight_smile:

power users should also engage with @midouest 's brilliant vs code plugin: Norns REPL (VSCode Extension)

I personally use sublime/vim a lot and love having a reload-on-save available from them as well with a mod like this.

4 Likes

quick note, relevant to vim/etc, a keystroke mapped to websocat command issuing norns.script.load() would be a hotkey for reload also

lightweight!

4 Likes

C-c ! R in norns.el (Emacs :heart: norns), but warmreload is without a doubt… warmer :slight_smile: Having this as a mod is a great idea.

1 Like

oh very cool man thank you

1 Like

Oh man, seeing such things that we discussed during the habitus workshop show up a few days later as a mod on the forum is such a nice gesture! Thanks, will give a try.

I’d like to start a thread on general dev environment and version control setup, or are there any relevant ones around already?

5 Likes

i may just not be remembering, but i do not recall thread about dev setup. <3

3 Likes

Installed warmreload and I have it running for a couple coding sessions now. Works like a charm :heart:

2 Likes