3 ms·
What notch used is a step further. From what I get this page simply "refreshes" the code and starts the execution anew. Notch is actually hot-swapping code, fo
by phn 14y ago
What notch used is a step further. From what I get this page simply "refreshes" the code and starts the execution anew.
Notch is actually hot-swapping code, for example the code in the update function of the game, leaving the game state intact.
If he wants to test a change in the init code for example, he would need to restart the program.
Either way, very cool way to play around with three.js without having to switch back and forth to the editor.
- jonnycowboy 14y agoIt might be possible to save the variable and ID states in the code before updating, then "pasting" them back in once reloaded.
- phoboslab 14y agoJohn Resig did the JavaScript hot-swapping approach for Khan Academy. Watch the screencast here: http://ejohn.org/blog/introducing-khan-cs/ http://ejohn.org/blog/introducing-khan-cs/
- outworlder 14y agoIs that documented anywhere?
- phn 14y agoI have no idea, I just remember it from the stream from notch. I also experimented a bit with something similar for python. You can find it here: http://www.krause-software.com/hotswap/ http://www.krause-software.com/hotswap/ I think it worked so well for notch because the code he was changing was in a different class than the program's entry point, so the virtual machine had it easy swapping the code. Once again, I don't know the details, it is just my impression from what I saw that time.