I had considered doing some similar things in the past.
I'd considered booting off of an EEPROM (not quite sure I remember why), and wrote some code for that, but never tested it.
One of the things that makes it much more difficult is that (I don't know if your code is the same way) if I typed save(); while my code was running, the only thing I could be sure of is that it would not come up in a remotely usable state. And that'd be the case even if I didn't delete onInit() after it runs to save memory...
I wonder how clean you could get it by having your onInit() code check for a signal that there's an update, and if so, delete all the functions and variables already defined, then load the files in (you'll need to break it up, as there's a limit on how large a chunk you can read from a file at once, and you can't pipe to exec() ), and those file swould recreate the stuff you deleted, and then you could have it save()?
My conclusion was that you have to design your whole program to be amenable to this sort of thing.
© Espruino, powered by microcosm.
Report a problem