←back to thread

490 points jarmitage | 1 comments | | HN request time: 0.216s | source
Show context
raytopia ◴[] No.40681705[source]
I love how many python to native/gpu code projects there are now. It's nice to see a lot of competition in the space. An alternative to this one could be Taichi Lang [0] it can use your gpu through Vulkan so you don't have to own Nvidia hardware. Numba [1] is another alternative that's very popular. I'm still waiting on a Python project that compiles to pure C (unlike Cython [2] which is hard to port) so you can write homebrew games or other embedded applications.

[0] https://www.taichi-lang.org/

[1] http://numba.pydata.org/

[2] https://cython.readthedocs.io/en/stable/

replies(8): >>40681794 #>>40681883 #>>40681919 #>>40682488 #>>40684037 #>>40685851 #>>40686919 #>>40693004 #
Joky ◴[] No.40682488[source]
> I'm still waiting on a Python project that compiles to pure C

In case you haven't tried it yet, Pythran is an interesting one to play with: https://pythran.readthedocs.io

Also, not compiling to C but to native code still would be Mojo: https://www.modular.com/max/mojo

replies(2): >>40683673 #>>40684432 #
holoduke ◴[] No.40683673[source]
Does it really matters in performance. I see python in these kind of setups as orchestrators of computing apis/engines. For example from python you instruct to compute following list etc. No hard computing in python. Performance not so much of an issue.
replies(2): >>40684527 #>>40687264 #
crabbone ◴[] No.40684527[source]
Marshaling is an issue as well as concurrency.

Simply copying a chunk of data between two libraries through Python is already painful. There are so-called "buffer API" in Python, but it's very rare that Python users can actually take advantage of this feature. If anything in Python as much as looks at the data, that's not going to work etc.

Similarly, concurrency. A lot of native libraries for Python are written with the expectation that nothing in Python really runs concurrently. And then you are presented with two bad options: try running in different threads (so that you don't have to copy data), but things will probably break because of races, or run in different processes, and spend most of the time copying data between them. Your interface to stuff like MPI is, again, only at the native level, or you will copy so much that the benefits of distributed computation might not outweigh the downsides of copying.

replies(2): >>40687267 #>>40688743 #
timomaxgalvin ◴[] No.40688743[source]
Python is a bad joke that went too far.
replies(1): >>40689597 #
1. mylons ◴[] No.40689597[source]
wow, someone thinks python is bad? what year is it? 2003?