processing / processing-experimental

Experimental Mode for the PDE
72 stars 25 forks source link

Add ability to hotswap code #67

Open JakubValtar opened 10 years ago

JakubValtar commented 10 years ago

How it works: run your sketch in debug mode, make changes to the code, hit save and the code gets instantly replaced in the running sketch. This is incredibly useful when prototyping and also opens Processing up to livecoding. For me, this is a killer feature of Processing (and whole Java), but currently I have to code in Eclipse or some other full-blown Java IDE. It would be nice if other people could use this too just with PDE X.

Manindra29 commented 10 years ago

How it works: run your sketch in debug mode, make changes to the code, hit save and the code gets instantly replaced in the running sketch.

I don't follow what you mean by 'code gets instantly replaced in the running sketch'. Afaik, if the sketch code gets updated, it need to be recompiled and run again.

but currently I have to code in Eclipse or some other full-blown Java IDE

Is something like this possible using the Eclipse Debugger? I didn't know about it..

JakubValtar commented 10 years ago

You can see it working here: https://www.youtube.com/watch?v=-IYrw6ocAMo Changes are limited to method bodies.

I don't follow what you mean by 'code gets instantly replaced in the running sketch'. Afaik, if the sketch code gets updated, it need to be recompiled and run again.

Modified classes are recompiled and redefined while program continues to run. More info: http://docs.oracle.com/javase/8/docs/technotes/guides/jpda/enhancements1.4.html#hotswap

Is something like this possible using the Eclipse Debugger? I didn't know about it..

As far as I know, this is supported at least by Eclipse, NetBeans and IntelliJ IDEA.

Manindra29 commented 10 years ago

Alright, I checked it out. It seems useful, although there are some concerns about the performance hit. Marking this as a feature-request.

Presently, our efforts are focused on fixing existing bugs. Will consider it again in the future.

JakubValtar commented 10 years ago

Thanks for looking into this!

there are some concerns about the performance hit.

I have been using this for livecoding for more than a year and performance is not an issue even on older computers. The swap is almost instant, I don't notice any framedrop.