5 ms·
Ah, yes, the "rewrite it all in C" theory of optimization. Meanwhile, PyPy continues to be a thing, writing most of its core in RPython and spanking CPython in
by DonbunEf7 9y ago
Ah, yes, the "rewrite it all in C" theory of optimization. Meanwhile, PyPy continues to be a thing, writing most of its core in RPython and spanking CPython in benchmarks. Why do we keep doing this?
- ciupicri 9y agoFrom https://faster-cpython.readthedocs.io/pypy.html https://faster-cpython.readthedocs.io/pypy.html (emphasis mine): > - Bad support of the Python C API: PyPy was written from scratch and uses different memory structures for objects. The cpyext module emulates the Python C API but it’s slow. > - New features are first developed in CPython. In january 2016, PyPy only supports Python 2.7 and 3.2, whereas CPython is at the version 3.5. It’s hard to have a single code base for Python 2.7 and 3.2, Python 3.3 reintroduced u'...' syntax for example. > - Not all modules are compatible with PyPy: see PyPy Compatibility Wiki. For example, numpy is not compatible with PyPy, but there is a project under development: pypy/numy. PyGTK, PyQt, PySide and wxPython libraries are not compatible with PyPy; these libraries heavily depend on the Python C API. GUI applications (ex: gajim, meld) using these libraries don’t work on PyPy :-( Hopefully, a lot of popular modules are compatible with PyPy (ex: Django, Twisted). > - PyPy is slower than CPython on some use cases. Django: “PyPy runs the templating engine faster than CPython, but so far DB access is slower for some drivers.”
- eat_veggies 9y agoA lot of the db drivers are written in C so that would make sense. It's really just the same problem.
- ATsch 9y agoYour comment is ironic considering RPython is (to oversimplify) nice syntactic sugar around C, and it is transpiled and then compiled with a normal C compiler. So one could argue that pypy is just as much optimisation by "rewriting it in C".