A new mode for Processing: The REPL Mode (with hints of Live Coding)

Hi all,

Just a quick post to say that a new REPL Mode is available for processing. It's Github repo may be found here. In addition to providing all the usual features that Processing 3.0 has to offer, the mode brings 2 main features to the table:

  1. An REPL Console This allows the user to type things in one command at a time, and view the output instantaneously (much like how an REPL Console would work for, Python, say).

  2. Hot swapping/ Live coding This allows the user to, after starting a sketch, type in code and simply save the sketch to view any changes to the output immediately in the open sketch, without requiring to restart the sketch (assuming, of course, that the sketch was saved once before running it).

More (much, much more) details can be found on the repo's readme page, and I'll be posting an introductory video soon.

As is usual, the most convenient way to install the mode is via the Contributions Manager.

I'd really love to hear how the community thinks this has turned out- bugs, missing features, what's right, what's not, suggestions, what crossed your mind when using the mode, whether or not you liked it and absolutely anything else.




  • edited September 2015

    Hi! I tried it and my first impression was that it may be awesome for teaching. Then I wished it could combine both modes. So I'm doing hot swapping and I can tweak global variables in the REPL at the same time. So I could create global x and y variables, draw a circle inside the draw loop in that position, change x and y in the REPL to see how it affects.

    I found a bug too. I open two processing sketches with REPL mode. I run the first one, which has an import. Stop it. The second one does not have that import. I try to run that one. It complains about the missing library (which was required by the first program, not the second).

    The bug hit me last night in a jam (about 10 people doing sound and graphics). I totally forgot that I had the REPL mode on. When getting errors, I had to keep closing Processing and opening again, and thought it was a 3.0 issue :) But no one was harmed, no worries :)


  • edited October 2017

    I just tried it out, and I think this is a very useful tool, although I couldn't get the REPL console to work just yet.

    EDIT: Oh, and this happens every so often, and I have no idea why. It crashes my sketch, too.

    Exception in thread "Thread-27" java.lang.NoSuchFieldError: editor at jm.mode.replmode.REPLRunner.exceptionEvent(Unknown Source) at processing.mode.java.runner.Runner$2.run(Runner.java:599)

    EDIT #2: I have decided to further investigate this problem and it turns out that I had a NullPointerException in my code. Still, @joel_moniz you will have to fix this issue so the sketch properly returns a NullPointerExpection instead of this rather confusing error.

Sign In or Register to comment.