Home

Awesome

REPL Mode for Processing 3.0

About

This mode adds in a Read-Evaluate-Print-Loop console to processing in the form of a tab at the bottom. The console enables users to type in processing code and to view the output of this code immediately. Each subsequent line of code shows the output incrementally, much like how an REPL Console for any interpretive language (like Python and the Linux bash terminal) would. The console also provides options to undo commands, to convert the valid commands entered so far into a function, and so on.

The mode also brings hot swapping to the table. This enables the user to view changes made to the sketch without the need for restarting the sketch.

Using the REPL Mode- a 2 minute guide

Using the additional features of the mode is simple:

Requirements

Building from Source

To build REPL Mode from source (recommended), do the following:

  1. Setup the correct paths in the resources/build.properties file. The following are likely the only paths that you will manually have to set:
  1. In the command prompt or terminal, simply run ant run from the resources directory (where the build.xml and build.properties files are present).

Using the hot-swapper

Using the hot-swap feature is super simple- simply save the sketch and run it and leave the sketch window open, and after making the required changes, save the sketch to have the sketch window display the contents of the updated sketch.

The REPL Console Commands

Navigating in the REPL Console

Use case

The REPL Mode is very similar to the Java Mode, and supports everything that the Java Mode does.
However, it aims to bring 2 new features to the table:

A typical "interaction" with the REPL Console may look like the following:

image

Bugs and Feature requests

Please file bugs and feature requests here.

Acknowledgements

A huge thank you to Manindra Moharana for helping me out every step of the way- in figuring out how to implement the UI, how to get the REPL part up and running, suggesting using the hot swapper, reviewing and testing everything extremely thoroughly, and so much more.
Special thanks to Florian Jenett for first conceiving the idea of an REPL Mode, for helping me out with the UI, and for suggesting a bunch of new handy features.