Processing in the browser : one day?

Hello :christmas_tree: ,

Today, it is possible to run a Java program in a browser through systems like TeaVM (or others), but this requires mastering somewhat complex things like Maven or Graven.

Will there be an export in Processing one day to obtain the same kind of things, that is to say running a Processing Program without having to rewrite it in P5js which remains painful as soon as a project is a little complex (that’s why Typescript exists!)?

:smiley:

Hi @EricRogerGarcia,

In the first place why would you want to run your Processing/Java project in the browser? Is your project too big to convert it to p5.js?

The difficult part of running a Java program in a web browser is that if you use any kind of specific Java APIs or libraries then it might break or you’ll need advanced Maven/Gradle configuration.

If you are starting a new project, just use p5.js.

You might want to take a look at:

Hello,

because you may want it to work on a desktop application AND in the browser. I know there is a current work on a new way on using p5js in the processing editor with nodejs so it should be possible to make applications too with it. it may be an answer !

In case, one use mainly, Processing, it should be possible to make an exportation in the browser with javascript and asm (but it is maybe too difficult, I don’t know).

It would be possible too to make an exportation of a processing program to a p5js one. It had been made in processing 3 (event if it was only a start).

It is difficult to use p5js with big applications (the problems are with javascript, not with p5js) that’s why typescripts exists. If there was some kind of exportation from processing to the web. Java in processing would be some kind of replacement for typescript (with this simple and quite powerful enough editor).

I’m currently working on a project with two versions : one in processing and one in P5js (see here)/ It’s time consuming to translate every modifications in Processing to P5js !

I can clearly see that there is a tendency to want to delete Processing and replace it entirely with P5js simply in my opinion for a fashion effect against Java (in the people who work for the foundation: why otherwise the question, in the last questionnaire whether it would be a serious problem for users?): I find that REALLY unfortunate!!!

In my opinion, presenting Processing as a kind of alternative to Typescript (with an export for the web) would be much more interesting for many people!

Processing makes it possible to approach Java (and even do quite a few things with it) by making it as simple to approach as Python for example. It would be very sad if it disappeared!!!

Java is one of the most used languages with Python, Javascript and C# (C/C++ apart from that): what do you have against Java!!!???

A huge amount of work has been done with Processing, it’s great: and some would like to put all this fantastic work in the trash!!!???

There are no programming languages better than others! There are only different use cases: that’s why it’s so good that Processing exists (mainly) in Java and Javascript version. I take this opportunity to greet with all my heart the work on Py5!!!

P.S. Thank you very much for giving me the opportunity to give my opinion on this:)

And one last word for the foundation (and it’s the same thing for other projects): organizations ask (and it’s quite normal) that we send them money to support them.

 but to do what with?

If we could indicate which specific project we wished to support, then we would necessarily send more money!!! 
 but no, it wouldn’t come to the idea of proposing this kind of thing!!!

P.S. and I wouldn’t write here if I wouldn’t loving this project
 for 20 years or more !

3 Likes

You seem quite passionate here but just pointing out that Processing has paid developers working on Processing, and that’s in addition to many other contributors. They clearly want it to thrive. You can see this on the People page, and there are a dozen commits, many issues, and conversations on Processing 4 including by Processing Foundation folks in the last week alone, in addition to libraries and documentation site they maintain.

3 Likes

Thank you very much for your message.

The truth is that I was extremely surprised by the question asked in the last survey (see my previous message) which feeds my fears about the evolution of the project.
On the other hand, I see that new functions appear in P5js (which is a very good thing) but they do not appear in Processing.
One of the major interests of Processing (in different programming languages), in my opinion, is that we have a common base. If the different versions move away from each other


It’s true that Processing (in general) fascinates me! It’s that I really find it incomparable. Other programming systems addressed (also) to non-programmers (professionals) choose to hide the underlying complexity (which is understandable, it is not a negative criticism). Processing does it completely differently: it facilitates access to this complexity. It’s a completely different approach.

On the other hand, being able to program “in the same way” in different languages is extremely formative. This really helps to understand that programming is not directly related to a particular language. It also, it’s incomparable!

If my fears are completely unfounded, I will be really very happy about it!

 but why this question in the last survey ???

N.B. The idea of being able to support a specific project within a large project like Processing (in general) would be interesting (in my opinion, of course).

friendly

(The question in the last survey I’m talking about was (basically): would it be a major drawback for you if Processing-Java disappeared? )

2 Likes

I agree on most of your points! I think that having to maintain two separate versions of the “same API” involve quite some work.

Since the web platform is evolving quickly and you can now run literally everything in it (through WASM), the Processing foundation might want to push forward making p5.js the main project (maybe?) :innocent:

Hi @EricRogerGarcia,

Raphaël here. I am the author of the 2025 Processing Community Survey. I can help answer your questions.

First to be clear, many people rely on Processing daily. The PDE got over one million downloads last year. Supporting the community is a core priority for the Processing Foundation, and we plan to continue maintaining Processing. It is not going away.

Now for context, the survey question you are referring to was:

If the Processing editor (PDE) were no longer available in the future, how much would this affect your work or teaching?

Assume you could write Processing code in other editors such as VS Code, IntelliJ, or Eclipse.

Side note: this was not about Processing Java but the Processing editor specifically.

with the optional follow-up:

If you would like, you can describe what would be most difficult to replace and why

The question is phrased this way because surveys often work better with this kind of wording.

If we simply asked people “what do you like most about Processing?”, many would give polite or vague replies. That is a common limitation in surveys. Questions framed as hypothetical changes prompt people to think about the things they really need.

Since we do not collect usage metrics inside the PDE, community feedback like this is the main ways we understand how Processing is actually used. As a small team, we have limited opportunities to run user research, so we try to design questions that give the clearest signal possible.

As mentioned above, the Processing Foundation is committed to securing the future of Processing. In fact, over the past two years we have been actively working to modernize both Processing Java and the PDE.

You can read more in the 4.5.1 release announcement, and watch our recent talk at Libre Graphics Meeting for a deeper look at these recent efforts.

And if you want to follow what’s happening with Processing and the PDE, feel free to join discord.processing.org. You can also drop by @moon’s community updates calls on Tuesdays (also on Discord) where we discuss the current development efforts.

@EricRogerGarcia I really appreciate your passion for Processing. And thanks @lee for taking the time to point to the ongoing work and contributors around the project :folded_hands:

Raphaël de Courville
Processing Community Lead

3 Likes

Thank you very much for enlightening me on these questions. And I will go see these links.

That’s great! Thank you!

P.S. I hope you are not going to drop the Processing Editor though but of course it depends on what you plan for the future

:grinning_face_with_smiling_eyes:

No, we are not planning to drop the Processing Editor. To restate:


Non, nous ne prĂ©voyons pas d’abandonner l’éditeur Processing. Comme prĂ©cisĂ© ci-dessus:

D’abord pour ĂȘtre clair : beaucoup de personnes utilisent Processing au quotidien. Le PDE a Ă©tĂ© tĂ©lĂ©chargĂ© plus d’un million de fois l’an dernier. Soutenir la communautĂ© est une prioritĂ© centrale pour la Fondation Processing et nous comptons continuer Ă  maintenir Processing. Il ne va pas disparaĂźtre.

Merci pour vos messages!

(Raphaël)

Cool beans!

This is stated in link below:

Processing Foundation is exploring #WebGPU and #WebAssembly to bring Processing to the browser

:)

2 Likes

!!! I will look at this obviously !!!

Since I can’t take care of 2 different versions of the same code anymore, I think I will only take care of the Javascript version!

What carried my decision, is to have seen the project of using P5js with easy creation of applications in the ongoing (and well advanced it seems) editing project in Processing of P5js with Nodejs and Electron.

.. but if we can one day export Processing in webassembly, I might come back to it later. We’ll see.

In any case, thank you very much for the info

:slight_smile:

P.S. I can’t wait to see what the relationship between Processing and BevyEngine is !!!

4 Likes

Hi! Come hang out in the discord and follow along with the development https://discord.processing.org we are not super into the WASM just yet, but we are on our way!

in the mean time i love that you’re doing what is right for you! javascript is great!

2 Likes

Thanks !!!

I add it on the list of links on my project readme text !


 coming !!!

P.S. I am really happy! Not only were my fears unfounded, but it seems that you are doing, or preparing to do exactly what I wished for Processing/P5js

The last thing on my list lol, is for someone to make a tool to translate the code from one version of Processing to another. I started looking to see how this kind of thing was done. I would like to have the time to take care of it because it seems really exciting to achieve but I already have enough to burn with my project: I don’t need to disperse! lol

Ohhh a transpiling project sounds really funnnn. It would be an interesting endeavor for sure. If you ever want to show and tell let me know. Though it sounds like a future plan :wink:

i appreciate your energy!

Well, it ‘d be fun to make it in Processing only so as to be used (or some code parts to be used for other things). The P5js → Processing, would ask the P5js code to have things written in comments like this :

class Thing {

   constructor(a,b) { // (String,int)
      ...
   }

   aMethod(c,d) { // (PVector,float) : int
      ...
      return e;  // e would be an int e.a. a Number in JS used for the int part
   }
}

The Processing → P5js should add this sort of comment too

All the tabs of a project would’nt be translated as some tabs would have to be written in P5js (for Processing→P5js or in Processing for P5js-Processing)
when the code is really different for a function or a class. (I had a tab compatibilityCode in Processing, and there is one in the P5js version too).

When I translated Processing code to P5js, the problems I had was only things like forgetting a this somewhere
 this kind of things. other things was logical errors I found in the Processing code as well.

Making the tokens doesn’t seem too hard

Making the AST Abstract Syntax Tree is the really interesting part !!!

It doesn’t seem so hard to do
 a long work to do it though

The Processing code would have to use only one constructor only for a class (using Fluent Interface Design Pattern) because the goal would be to have “the same code” in Processing and P5js.

The idea to not using any library would permit to have this code translated itself to P5js.

This is the state of my reflections on the subject

P.S. Java interfaces would be ignore :slight_smile:

class aClass implements anInterface {

would be translated in JS

class aClass { // implements anInterface

and Interface code would stay the same between

/* and */

I think, for now, that you may don’t use any enum in Java and replace it with Strings comparison using hashcode (so int comparison actually) so enum could be not translated.

I use hashcode in JS (not difficult to add to JS)

@EricRogerGarcia Though it doesn’t seem actively maintained, you might find the following project interesting.

From the README:

processing-p5-convert is a source code translator that that converts Processing/Java code to p5.js/Javascript code. It includes a command line tool, and can also be used in the browser to convert and run Processing sketches.

Source code translation is implemented by parsing the Processing/Java code into a syntax tree. The syntax tree retains all code symbols, which facilitates reconstruction of the source code. processing-p5-convert walks the syntax tree, performing transformations as it reconstructs the source code.

3 Likes