uvloop
uvloop copied to clipboard
Could uvloop be implemented using CFFI?
Could uvloop be implemented using CFFI? How hard would it be to do so?
I ask because at some point in the future PyPy3 will reach compatibility with Python 3.5 (It could be a while, but PyPy3 3.3 is in alpha right now so there is hope :-) and it would be really great if uvloop were usable on it :-)
Once PyPy implements Python 3.5 and is stable, we'll look into this. Theoretically, it's not that difficult to rewrite uvloop with pure Python + CFFI.
That's good to know. Thanks for answering my question!
NP. Let's keep this issue open, as this question periodically comes up.
@1st1 by the way, you can already play around PyPy3.5, there's nightly builds: http://buildbot.pypy.org/nightly/py3.5/ It's not stable thought
@1st1 the time has come! First public release of PyPy3.5
I'll take a look soon :)
Referencing another discussion: https://github.com/MagicStack/uvloop/issues/82
https://github.com/saghul/pyuv already implements a CFFI extension that works on PyPy3 beta. It's just a matter of providing the necessary Python API that wraps it.
@thedrow Where is CFFI in pyuv? I see no CFFI here, only usual Python C extension. If uvloop would use pyuv, PyPy3.5 would be slower, because Python C Extensions are slower than CFFI extensions (in PyPy). Uvloop wants to be fast, so if it wants to be fast on PyPy it should use CFFI
@thedrow , @1st1, I found this uvloop CFFI extension - https://github.com/koehlma/uv/
Seems like the CFFI extension is no longer maintained :(
Maybe it is worth seeing what is necessary to make the existing Cython code work on PyPy. Cython supports cpyext for PyPy and PyPy has done some recent work to improve cpyext speed. Have people explored this path? If so, what are the known issues today?
I'm writting an PyPy binding using CFFI for and webserver, and i really need an CFFI version, so i think i will start to write an CFFI extension for PyPy using uvloop as reference, is that ok? The project: https://github.com/cirospaciari/socketify.py
@cirospaciari We're hoping Cython could emit HPy extension code in the future which will allow uvloop to run on multiple platforms easily.
Related issue ( https://github.com/cython/cython/issues/4197 )