# Creating a Processing Library from JavaScript code

**URL:** <https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508>\
**Category:** Development\
**Created:** [June 12, 2022, 5:35pm UTC](https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508 "2022-06-12T17:35:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grumpy_mike/32/14787_2.png) [@Grumpy\_Mike](https://discourse.processing.org/u/Grumpy_Mike)\
**Post date:** [June 12, 2022, 5:35pm UTC](https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508/1 "2022-06-12T17:35:57Z")

</div>

A recent kick starter project was for some Bluetooth connected dice.  
[GoDice](https://www.kickstarter.com/projects/1928372437/godice-your-favorite-dice-games-reimagined)

The makers then posted an API in the form of a JavaScript example.  
[GoDice JavaScript API](https://github.com/ParticulaCode/GoDiceJavaScriptAPI)

Anyone know how this can be made to run in Processing?  
Maybe even create a Processing library.

Thanks

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [June 15, 2022, 6:14pm UTC](https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508/2 "2022-06-15T18:14:48Z")

</div>

Hi @Grumpy_Mike

It doesn’t look like there is much to do to port to java by looking at the js code but also not knowing how experienced your java coding is. Just try it and if you encounter obstacles, you can post the code and we can then see how to solve the possible issues.

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grumpy_mike/32/14787_2.png) [@Grumpy\_Mike](https://discourse.processing.org/u/Grumpy_Mike)\
**Post date:** [June 15, 2022, 7:17pm UTC](https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508/3 "2022-06-15T19:17:44Z")

</div>

Thanks for the reply.

> [@mnse](#):
>
> also not knowing how experienced your java coding is.

Never done any java coding, mainly C, BBC BASIC, Python plus various machine code instruction sets and Processing.

Do you have any examples of running a java class in processing, perhaps I could get an idea what is involved by seeing that.

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [June 15, 2022, 7:47pm UTC](https://discourse.processing.org/t/creating-a-processing-library-from-javascript-code/37508/4 "2022-06-15T19:47:30Z")

</div>

Ok!  
The godice sounds quite interesting and it would be surely fun to port it to java … but to be honest, I wouldn’t pay 100+ bucks for it and without one the testing of the port would be almost difficult. 😁

Cheers  
— mnse
