We are about to switch to a new forum software. Until then we have removed the registration on this forum.
WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ with a compilation target so that they can run on the web.
There are some repositories in GitHub, e.g. https://github.com/konsoletyper/teavm, to compile Java bytecode to webassembly or to javascript directly. Then I think it is possible to compile Procesing-Java sketch to webassembly format, and run them natively in browser.
As far as I know, there are two ways to run Processing-java sketches in browser, one is processing.js, other is p5.js.
The performance of webassembly is much better than p5.js or processing.js, IMO. And there is no need to rewrite the code.
But now there is no official webassembly support for Java, maybe it is full of challenges.
Welcome to join the discussion!
Answers
The problem with Java directly in webassembly is that you would have to implement the JVM on it.
There are transpiling approaches:
Although:
And: