是什么阻止了处理库被用于processing.js
对于那些不知道的人来说,Processing 是一种语言/Java 库,主要用于漂亮地显示数据。
Processing.js 是 John Resiq 制作的 javascript 端口。那家伙所做的一切都是宝藏。
根据之前的问题,我了解到Processing 的许多库在processing.js 中无法工作。这是为什么呢? Processing 提供了一个临时编译器,可以将处理代码转换为 javascript 等效项。
对于这个问题的背景,我正在为最后一年的项目构建一个游戏,并正在考虑使用processing.js 作为基础。阻碍processing.js在网络中成为更大力量的原因是缺乏库(值得一提的是box2d.js)。
processing.js 的两个问题是 pde 到 js 的编译器不处理任何其他processing.js 库。仅核心处理对象和函数。
另一个是完全缺乏与processing.js 一起使用的处理库
。所以问题总结如下:
是什么阻止了processing 和processing.js 使用已经构建的库?
是否值得我花时间遵循 John resiq 的步骤并将一些处理库移植到 Javascript?算起来,他花了7个月的时间。
是否值得在他的编译器之上构建并尝试使其在某种程度上动态地确定外部库被调用的位置。
For those that don't know, processing is a language/ Java library primarily used for displaying data nice and pretty.
Processing.js is its javascript port made by John Resiq. Everything that guy makes is a treasure.
As per a previous question I learned that Processing's many libraries would not work in processing.js. Why is this? Processing provides a makeshift compiler that turns the processing code into its javascript equivalent.
For context to this question, I'm building a game for a final year project and am looking into using processing.js as the base. Whats holding the processing.js back from being an even bigger force in the web is the lack of libraries (honorable mention to box2d.js).
The 2 problems with processing.js is that the compiler for pde to js doesn't handle any other processing.js libraries. Only the core processing objects and functions.
The other is the sheer lack of Processing libraries ported to work with processing.js
So the question summarized:
What is it that holds processing and processing.js back from using the libraries already buit?
Is it worth my time following John resiq's steps and porting some of the processing libraries to Javascript? bare in mind, it took him 7 months.
IS it worth while building on top of his compiler and trying to make it somewhat dynamic in figuring out where external libraries have been called.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Processing.js 和Processing 可能看起来很相似,但显然还是有区别的。
AFAIK 处理的目的是让希望通过编程扩展工具集的设计师/艺术家的生活变得更轻松。
最初它是作为一个 Java 库和一个最小的 IDE(PDE)构建的。
Processing.js 是该库在 JavaScript 中的端口。
这意味着虽然对用户来说,Processing 和Processing.js 可能看起来相同,但幕后的实现却非常不同。实际上,Java 与 Javascript 是不同的:)
要理解为什么处理库不能在Processing.js 中工作,就要理解 Java 和 Javascript 之间的差异。例如,javascript 是一种由浏览器解释的脚本语言,而 java 代码则编译为字节码,然后由虚拟机(Java 虚拟机 (JVM))执行)。
总之,您不能将处理库(这是一个 Java 库)与 Processing.js 一起使用,但如果您愿意,可以将处理库从 Java 移植到 Javascript。
Toxiclibs.js 就是一个很好的例子。
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.