4 ms·
Libraries like numpy are implemented in C under the hood, and you can also easily extend your Python code with C.
by alejoar 6y ago
Libraries like numpy are implemented in C under the hood, and you can also easily extend your Python code with C.
- enriquto 6y ago> you can also easily extend your Python code with C Or, more precisely, you can easily wrap your algorithm written in C by a bit of boilerplate Python code (if that is your fancy).
- fauigerzigerk 6y agoOr you could use Cython to do a bit of both at the same time.
- enriquto 6y agoI don't see the advantage. If you use cython then your code becomes quite difficult to use in the rest of the C ecosystem (where your algorithm belongs).
- counters 6y agoUsually if you use Cython, f2py, numba, or something similar, the goal isn't to create code that fits into the ecosystem of the compiled language - it's to optimize a kernel that fits into the Python ecosystem with minimal baggage.