What is it that stops processings libraries from being used to processing.js

旧城冷巷雨未停 提交于 2019-11-29 05:16:01

Processing.js and Processing may look similar, but obviously there are differences.

AFAIK Processing was made to make the life of designers/artists wanting to extend they're toolset via programming easier. Originally it was built as a Java library and a minimal IDE (the PDE). Processing.js is a port of that library in javascript.

This means that while to the user, Processing and Processing.js may look the same, behind the scenes the implementation is very different. As different as Java is to Javascript actually :)

To understand why Processing libraries won't work in Processing.js is to understand the differences between Java and Javascript. For example, javascript is a scripting language interpreted by the browser, while java code get's compiled into bytecode that is then executed by a virtual machine (the Java Virtual Machine (JVM)).

In conclusion, you can not use a Processing library (which is a Java library) with Processing.js, but you can port a Processing library from Java to Javascript if you want to. Toxiclibs.js is great example of that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!