3 ms·
It saddens me, that one of Pythons strengths - its C extensions - appear as a weakness in this context. The culprit is, that we perceive python as 'what you c
by fifticon 6y ago
It saddens me, that one of Pythons strengths - its C extensions - appear as a weakness in this context.
The culprit is, that we perceive python as 'what you can DO through python' - which is a very reasonable perspective.
But precisely python's useful boosting through C extensions, also anchors it to its friends.
So, it's the old conundrum of what goes into a language core, versus what api library environment it lives in.
- throwaway894345 6y agoAs I point out elsewhere it’s possible to have both performance and C-extensions, but the extension interface needs to be minimized so Python implementations have some breathing room to make optimizations—today almost any optimization would break the expansive extension interface. There are projects (like this: https://github.com/pyhandle/hpy https://github.com/pyhandle/hpy) which aim to make a smaller interface, but the community must adopt this overwhelmingly before the old interface could be deprecated and work could begin to optimize any Python implementation.
- physicsyogi 6y agoThe C extensions are partly why Python reigns in the machine learning and data science world.
- gnulinux 6y agoThis is why I still use Python in performance critical code (but not so performance critical that you need to squeeze each CPU cycle). It's simply too easy to write performance critical functions in C and ffi call it in python. Of course, compared to many other language it's still slow "in general" but for your give particular task it's pretty easy to make it very fast. Just write the bottlenecking tight loop in C and everything else can be in python.
- carlmr 6y agoRust with it's Cargo package manager, unicode string handling and strong type system is really great for Python speed-ups: https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/ https://developers.redhat.com/blog/2017/11/16/speed-python-u...