P5.js vs javascript

This is a good comparison to make, but also a bit misleading.

p5.js is written in valid JavaScript. When you write p5.js, you are writing JavaScript, but using a library.

Processing (Java mode) as documented in sketches and written in PDE with .pde files is not written in valid Java. Processing is its own Java-like dialect, and the contents of pde files must be transformed later into valid Java before it runs on a Java virtual machine. You can use Processing as a Java library (e.g. in Eclipse) and write it using valid Java – for what that looks like, see:

https://processing.org/tutorials/eclipse/

However none of the Processing examples or reference documentation demonstrate this valid Java mode – they are all in written in the Processing dialect for PDE.

2 Likes