Libraries and Processing.js
in
Library and Tool Development
•
8 months ago
There are more and more questions on the forum about using existing 3rd party libraries with Processing.js and as a library developer I am interested in porting some of my libraries to JS.
Looking at the website I found this article and in it it states
______________________________________________________________________________________
I have been thinking of making my libraries cross-mode and being realistic I don't think that is a viable option. The problem is that some of my libraries make use of Java language features such as the Java collections and reflection which are not available in JavaScript or in the Processing API
So unless someone knows better it seems that I have three choices
Options 2 and 3 would need a mechanism to integrate 3rd party JavaScript into the sketch. Does anyone know if this already exists?
Anyway these are some of my initial thoughts and it would be good to hear other people's thoughts on this topic.
Looking at the website I found this article and in it it states
So my first question is what stage has this reached?If you are a library creator and are interested in creating a JavaScript compatible library, stay tuned as we are developing standards and methods for doing so.
______________________________________________________________________________________
I have been thinking of making my libraries cross-mode and being realistic I don't think that is a viable option. The problem is that some of my libraries make use of Java language features such as the Java collections and reflection which are not available in JavaScript or in the Processing API
So unless someone knows better it seems that I have three choices
- rewrite the libray to only use methods available in the Processing API and then let Processing.js convert it to JavaScript and omit those elements that can't be implemented.
- rewrite as much of the library as possible using the Processing API and create pure JavaScript code for those remaining parts.
- rewrite the library in pure JavaScript
Options 2 and 3 would need a mechanism to integrate 3rd party JavaScript into the sketch. Does anyone know if this already exists?
Anyway these are some of my initial thoughts and it would be good to hear other people's thoughts on this topic.