Hacker News new | past | comments | ask | show | jobs | submit login
Py5, a Python version of Processing for your creative coding projects (py5coding.org)
90 points by hx2a 3 months ago | hide | past | favorite | 31 comments



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.


Yep. In case you don’t want to write Java you can do it in Python. But it uses the same engine


I suppose jython would be particularly useful in such cases


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.


Check out GraalPy, part of the GraalVM project. My company has switched from Jython to GraalPy with relatively little work.


I've also worked with a python->javascript transpiler and hooked it into p5.js if your more into that


using Jython prevents you from using the regular Python ecosystem though


It seems like an axiom that no Python package can be written that does not depend on C/C++/Java doing the real 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).

[1] https://programming-language-benchmarks.vercel.app/cpp-vs-py...


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.


Because the concept of variables must be learned before the concept of scope.


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!


I can foresee the name of this causing issues in a decade or two when python releases version 5.


I think everyone who has gone through the 2->3 transition will have to be dead before 3->4 will have a chance of even being considered. :-)


Python 95 :)


As someone who heavily uses Manim with Python, I like the idea. But I really don't want to use 'Py5' if it then has a Java dependency.


I see the Processing folks have not lost their touch for unnecessarily confusing names. Why on earth would they call this “py5”?


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."

https://github.com/processing/p5.js/issues/2443


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.


"X is a new version of Y" is a really uninformative way to introduce a project.

It's especially annoying when I click the link to Y and it just says "This repository contains the source code for Y".


Is this any faster than Processing? I like playing with it for random art projects but always end up in optimization hell trying to speed things up.


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.


Yeah, I think most times it isn't the drawing but the calculations I'm doing in the background, I'll have to try this out.


It took way too many clicks for me to figure out what this project is. And I'm still not entirely sure.


It's a Python wrapper for a popular Java tool.


…which isn't a great explainer if you're not familiar with that Java tool.

Seems like it's an alternative to tk/tkinter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: