<story><title>Realtime Three.js Coding</title><url>http://mrdoob.com/projects/code-editor/</url></story><parent_chain><item><author>terhechte</author><text>I love it. Reminds me of the Hotswap feature in Eclipse which Notch seems to use a lot for building his games. I wish there was something like that for UILayer, UIView and OpenGL in Objective-C. I know about the REPL in RubyMotion, but it&apos;s Ruby and a REPL is still not the same as having a live preview of editor changes. I really hate the fix-compile-test workflow, and especially for layers and layer animations and so on, I keep myself compiling and restarting an app multiple times until the speed, delay, looks parameters feel &lt;i&gt;right&lt;/i&gt;.&lt;p&gt;I guess it&apos;s really difficult to implement something like that in Objective-C though. While it&apos;s possible to replace methods through method swizzling with new methods (say from a category), and while Objective-C allows to add categories to a NSBundle and dynamically add that NSBundle to a running app, this doesn&apos;t work on iOS as far as I know due to security limitations.</text></item></parent_chain><comment><author>mbell</author><text>The hot-swap capability isn&apos;t something specific to Eclipse, its built into the JVM.  Its also pretty limited, you can only change method bodies, you can&apos;t add methods, classes, class variables, and often things like annotation changes aren&apos;t picked up.  Eclipse, IntelliJ, etc all use this.  There is JRebel which is a custom implementation that allows much more robust code injection, but its not free.&lt;p&gt;Hotswap is great for tweaking values/logic after you&apos;ve nailed down your method flow but it can have negative effects as well which aren&apos;t immediately apparent.  I&apos;ve seen a few hunks of code end up overly complicated as the developer hit a point where they really needed to break the code into more methods but didn&apos;t since you can&apos;t Hotswap in new methods and they didn&apos;t want to wait for the app to restart.&lt;p&gt;I don&apos;t really know how you would do this with Objective-C as its compiling to machine instructions.  It would be very tricky as you don&apos;t have the luxury of a VM that explicitly supports it running your code.</text></comment>
<story><title>Realtime Three.js Coding</title><url>http://mrdoob.com/projects/code-editor/</url></story><parent_chain><item><author>terhechte</author><text>I love it. Reminds me of the Hotswap feature in Eclipse which Notch seems to use a lot for building his games. I wish there was something like that for UILayer, UIView and OpenGL in Objective-C. I know about the REPL in RubyMotion, but it&apos;s Ruby and a REPL is still not the same as having a live preview of editor changes. I really hate the fix-compile-test workflow, and especially for layers and layer animations and so on, I keep myself compiling and restarting an app multiple times until the speed, delay, looks parameters feel &lt;i&gt;right&lt;/i&gt;.&lt;p&gt;I guess it&apos;s really difficult to implement something like that in Objective-C though. While it&apos;s possible to replace methods through method swizzling with new methods (say from a category), and while Objective-C allows to add categories to a NSBundle and dynamically add that NSBundle to a running app, this doesn&apos;t work on iOS as far as I know due to security limitations.</text></item></parent_chain><comment><author>phn</author><text>What notch used is a step further. From what I get this page simply &quot;refreshes&quot; 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.&lt;p&gt;Either way, very cool way to play around with three.js without having to switch back and forth to the editor.</text></comment>