# Convert p5.js to Processing

**URL:** <https://discourse.processing.org/t/convert-p5-js-to-processing/944>\
**Category:** p5.js\
**Created:** [June 14, 2018, 2:58am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944 "2018-06-14T02:58:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![codingking03](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@codingking03](https://discourse.processing.org/u/codingking03)\
**Post date:** [June 14, 2018, 2:58am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/1 "2018-06-14T02:58:45Z")

</div>

Is there any easy way to convert p5.js code to processing (java)?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 14, 2018, 4:45am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/2 "2018-06-14T04:45:21Z")

</div>

> **[r/processing - OpenProcessing: converting code written in Java to JavaScript](https://www.reddit.com/r/processing/comments/7dqqvh/openprocessing_converting_code_written_in_java_to/dq0ecac/)**
>
> 9 votes and 14 comments so far on Reddit

---

<div class="post-metadata">

**Author:** ![codingking03](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@codingking03](https://discourse.processing.org/u/codingking03)\
**Post date:** [June 14, 2018, 4:49am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/3 "2018-06-14T04:49:58Z")

</div>

Ok it looks like I need to know some of both languages to work efficiently between the two

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 14, 2018, 4:54am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/4 "2018-06-14T04:54:31Z")

</div>

JavaScript is Java on the web. It means both languages got a lot in common! ☕  
Even though you wanna go back to “offline” Java, it shouldn’t be that difficult at all: 😇

- [https://Github.com/processing/p5.js/wiki/Processing-transition](https://Github.com/processing/p5.js/wiki/Processing-transition)

Just take a look at my Reddit post and compare how the same sketches are written in Java & JS syntaxes. 😀

---

<div class="post-metadata">

**Author:** ![codingking03](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@codingking03](https://discourse.processing.org/u/codingking03)\
**Post date:** [June 14, 2018, 7:27am UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/5 "2018-06-14T07:27:45Z")

</div>

I have found that this is true! But I have - as it is very easy to - gotten used to the whole var/auto data type

---

<div class="post-metadata">

**Author:** ![theslyprofessor](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@theslyprofessor](https://discourse.processing.org/u/theslyprofessor)\
**Post date:** [July 18, 2020, 8:43pm UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/6 "2020-07-18T20:43:32Z")

</div>

JavaScript and Java are actually completely different languages. The name JavaScript was chosen to ride the coattails of Java’s success.

---

<div class="post-metadata">

**Author:** ![istinn](https://avatars.discourse-cdn.com/v4/letter/i/c4cdca/32.png) [@istinn](https://discourse.processing.org/u/istinn)\
**Post date:** [September 14, 2022, 2:10pm UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/7 "2022-09-14T14:10:55Z")

</div>

Do you know any additional guide/tutorials other than the [Processing-transition](https://github.com/processing/p5.js/wiki/Processing-transition) wiki page? It seems there are several tools at GitHub to experiment automated conversion on java-processing to p5.js code but not the opposite.  
Do you know by chance any sketch examples exposing both language code, in order to study/compare the differences?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 14, 2022, 3:18pm UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/8 "2022-09-14T15:18:35Z")

</div>

> [@istinn](#):
>
> Do you know by chance any sketch examples exposing both language code,

Haven’t you taken a look at my Reddit link from my 1st reply for this topic btW? 🙈

Anyways, I’ve got quite some more Java + p5js sketches for you to compare both syntax flavors: 🍦

* * *

> **[Players Movement (Java) - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/718355)**
>
> https://Reddit.com/r/processing/comments/bshqa8/how\_would\_i\_make\_a\_keypressed\_function\_support/eor5epo/

> **[Players Movement (p5js) - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/717760)**

* * *

> **[3D Knot (Java) - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/608725)**
>
> https://YouTu.be/r6YMKr1X0VA

> **[3D Knot (p5js) - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/608726)**

* * *

> **[Trig Pixel Colors \[Java/Pjs\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/1637958)**
>
> https://Discourse.Processing.org/t/pixels-array-p5-js-vs-java/38623/2

> **[Trig Pixel Colors \[JS/p5js\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/1637961)**
>
> https://Discourse.Processing.org/t/pixels-array-p5-js-vs-java/38623/2

* * *

> **[Sierpinski Pentagon \[Java\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/955443)**

> **[Sierpinski Pentagon \[p5.js\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/955445)**

* * *

> **[Sierpinski Condensed \[Java\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/954181)**

> **[Sierpinski Condensed \[p5.js\] - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/954178)**

* * *

> **[Ramer–Douglas–Peucker Algorithm - GoToLoop - OpenProcessing](https://openprocessing.org/sketch/747172)**
>
> Switch "Infinite Loop Protection" on and off in order to run it.

> <https://gist.github.com/GoSubRoutine/da4939559d8b786df13f5694ea2edd30>
>
> There are more than three files. show original

* * *

---

<div class="post-metadata">

**Author:** ![istinn](https://avatars.discourse-cdn.com/v4/letter/i/c4cdca/32.png) [@istinn](https://discourse.processing.org/u/istinn)\
**Post date:** [September 14, 2022, 3:38pm UTC](https://discourse.processing.org/t/convert-p5-js-to-processing/944/9 "2022-09-14T15:38:44Z")

</div>

wow… it seems I have missed this obvious post… But It is nice to see those examples as headlines here. Very Hard to miss them now… thanks!
