I don't get it, I thought this was a port of Processing to Python, but then the installation instruction says:
> If you have Java 17 installed on your computer, you can install py5 using pip:
So it still depends on Java? Is this like a Python wrapper for Processing?
UPDATE: Got the explanation. From another page on the website:
> Py5 is a creative coding framework for Python 3.9+. Its use and functionality is analogous to the widely used Processing framework. It is a Python version of Processing.
> Internally py5 uses Processing’s core libraries, which are written in Java, while providing the end user with a (mostly) seamless Python programming experience.
Emphasis is mine. The wording in the first paragraph (which is the same as on the project's home page) seems ambiguous to me. Reading it I would really not expect a Java dependency.
People have got Processing working Jython (I played with it myself a very long time ago).
Jython itself is making it's way to a python 3.x implementation but it doesn't seem to be quite there for general consumption, though maybe for some creative coding things this isn't a problem, for myself I'd need to wait until it's ready.
If you are able, I'd recommend contributing to the Jython 3 work.
Python is successful because everyone is aware that it has relatively terrible performance. As a result, anything remotely heavy is put into performant libraries that use not-python, leaving a nice glue language with fast libraries.
If you have something CPU bound, and it's python code hitting that ceiling, you're probably throwing away 10x performance [1]. That's ok, because anyone that cares about performance doesn't do that (or quickly learns).
Why would you rewrite something that already exists? It'd be a different story if the library evolved naturally starting with python, which it very much might if it was created today.
Why must every educational python library insist on teaching kids with global variables? I know parameters aren't easy for novices, but it feels like it's missing a lot of the value when we don't attempt to teach them...
Because it's perfectly fine for 100 line programs. Beginners don't need to write extensible code that will be maintained for 30 years on business critical systems. You start by learning what a fuckin for loop does.
Not only that, it's a relatively gentle introduction into object oriented concepts, where an instance is just like independent copies of modules, as they're using them: module.function(), with function accessing some global conceptually turns into instance.function() where function accesses some instance "global".
I was always a bit surprised that python didn't allow "module instances" that automatically did that.
Honestly the way I learned not to use a ton of global variables was because I used so many and would forget what they'd do. But that was back in the days of Apple // BASIC so when I was introduced to C I rejoiced. People need to learn from mistakes.
For me, I learned when I wanted all my function calls to do the same thing no matter how many times, or order, I called them.
I often wonder how much "pain" is required to really learn something. I would claim that 90% of how I write code is the result of pain, not patterns, even though they often end up being similar.
True, but having a single scope is more intuitive at first for people who don't have a good grasp of what a function is and are still trying to understand programming. Also processing/p5 kind of focuses on the speed and accessibility of getting an idea going, for which a game-loop and a single func scope are quite powerful!
the javascript version of processing is called p5js. According to the creator the 5 comes from "the original domain of processing was proce55ing.net, so people used to sometimes refer to processing as proce55ing or P5 or p5 for short. they still do sometimes. p5.js is a reference to that."
Thanks for the answer, although it reinforces my point I think. I remember when Processing was the hot new thing and reading about it was incredibly confusing.
I would assume that drawing performance is slower because it’s doing FFI from CPython to the JVM, but that you may be able to get speedup if your bottleneck is something that can leverage numpy.
> If you have Java 17 installed on your computer, you can install py5 using pip:
So it still depends on Java? Is this like a Python wrapper for Processing?
UPDATE: Got the explanation. From another page on the website:
> Py5 is a creative coding framework for Python 3.9+. Its use and functionality is analogous to the widely used Processing framework. It is a Python version of Processing.
> Internally py5 uses Processing’s core libraries, which are written in Java, while providing the end user with a (mostly) seamless Python programming experience.
Emphasis is mine. The wording in the first paragraph (which is the same as on the project's home page) seems ambiguous to me. Reading it I would really not expect a Java dependency.