4 ms·
100% python and fast? Either it isn't 100% python, or it isn't fast.
by dr_kretyn 2y ago
100% python and fast? Either it isn't 100% python, or it isn't fast.
- zamadatix 2y agoDepends where your boundary for "100% Anything" is I suppose. It seems to use GPU accelerated kernels written in Python via the Taichi library for most of the physics calculations. At some point, sure, the OS+GPU driver+GPU firmware you need to run the GPU accelerated kernel are not written in Python (and if you run it on CPU instead it will be slow, but more because you're using the CPU than you're not using C or something). There is a bit of numpy too, which eventually boils down to some non-Python stuff (as any Python code eventually will). I'm not sure that's a useful distinction or that the choice of language in defining the kernels makes a meaningful difference on the overall performance in this case.
- dr_kretyn 2y agoThe doc emphasizes "100% Python" and that backend is natively in Python. I'm reading this as "you don't need anything else than Python interpreter." Given a large number of packages aren't in Python under the hood, that's a big, unnecessary hyperbole. It's Ok to acknowledge that there's a heavily reliance on non-python code, e.g. Taichi or Numpy. I also think that the distinction isn't particularly useful. Just pedantic claims will get pedantic feedback.
- dragonwriter 2y agoIt’s particularly useful if it is an open source project and you want to communicate to people who might want to hack on it (either in a fork or the main project) what languages they will need to work directly with to do so. It’s not important to end users, but they aren’t the only audience.
- dragonwriter 2y agoThe Genesis code itself is 100% python. The underlying Python libraries it uses are not (just as, or that matter, the Python standard library isn’t, but this is, in particular, using Numba – which compiles fairly normal Python to CPU and optionally GPU-native code – and Taichi, which compiles very specially-crafted Python to kernels for GPU.)
- rohan_ 2y agopython is a spec - not an implementation. It could be using CPython or Mojo, and still be Python.