tag:blogger.com,1999:blog-3971202189709462152.post8991437796535033699..comments2024-03-11T12:50:02.036+01:00Comments on PyPy Status Blog: PyGame CFFICarl Friedrich Bolz-Tereickhttp://www.blogger.com/profile/00518922641059511014noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-3971202189709462152.post-37904369378143510452016-05-04T11:16:50.290+02:002016-05-04T11:16:50.290+02:00Development occurs at https://github.com/CTPUG/pyg...Development occurs at https://github.com/CTPUG/pygame_cffi nowadays.Armin Rigohttps://www.blogger.com/profile/06300515270104686574noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-42882763013494331882016-05-03T02:01:05.402+02:002016-05-03T02:01:05.402+02:00great! what's current status of it? I really ...<br />great! what's current status of it? I really can't wait to use Pygame on a PI through pypy.Kareliumhttps://www.blogger.com/profile/03407744168764891480noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-33027849709947231502013-12-16T19:49:25.564+01:002013-12-16T19:49:25.564+01:00I am +1 on porting PySDL2 to CFFI instead of pygam...I am +1 on porting PySDL2 to CFFI instead of pygame.anatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-81713001352779372412013-12-15T22:48:13.266+01:002013-12-15T22:48:13.266+01:00yes, you need a vastly newer pypyyes, you need a vastly newer pypyMaciej Fijalkowskihttps://www.blogger.com/profile/11410841070239382771noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-26374631239879263452013-12-15T22:32:53.710+01:002013-12-15T22:32:53.710+01:00Hm, I can't get this to work on Ubuntu 12.04 d...Hm, I can't get this to work on Ubuntu 12.04 doing the following<br /><br />virtualenv -p /usr/bin/pypy pypy<br />cd pypy<br />source bin/activate<br />pip install git+https://github.com/eliben/pycparser.git<br />pip install hg+https://github.com/eliben/pycparser.git<br />pip install hg+https://bitbucket.org/cffi/cffi<br />git clone https://github.com/CTPUG/pygame_cffi.git<br />cd pygame_cffi/<br />pypy<br />import pygame<br /><br />>>>> import pygame<br />Traceback (most recent call last):<br /> File "", line 1, in <br /> File "pygame/__init__.py", line 9, in <br /> from pygame.color import Color<br /> File "pygame/color.py", line 3, in <br /> from pygame._sdl import ffi, sdl<br /> File "pygame/_sdl.py", line 6, in <br /> ffi = cffi.FFI()<br /> File "/home/me/Documents/python/pygame/pypy/site-packages/cffi/api.py", line 56, in __init__<br /> import _cffi_backend as backend<br />ImportError: No module named _cffi_backend<br /><br /><br />dpkg -l pypy<br />...<br />ii pypy 1.8+dfsg-2 fast alternative implementation of Python - PyPy interpreter<br /><br /><br />Do I need a newer pypy? Am I missing something else?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-58041560396531966452013-12-11T00:33:38.730+01:002013-12-11T00:33:38.730+01:00I've been looking at cffi since it was first m...I've been looking at cffi since it was first mentioned on our Pygame mailing list. It does look promising. I see only two, buffer related, issues that need to be resolved.<br /><br />First, PyPy lacks an array export mechanism comparable to the <a href="http://www.python.org/dev/peps/pep-3118/" rel="nofollow">CPython PEP 3113 buffer protocol</a>. Instead, only the <a href="http://docs.scipy.org/doc/numpy/reference/arrays.interface.html" rel="nofollow">NumPy Array Interface, version: 3</a> is available. Though Pygame supports both the Python and C sides of the interface, it relies on CPython's reference counting for timely buffer release [1]. Periodic garbage collection is too unpredictable.<br /><br />Second, the cffi module does not support CPython api function calls. So a cffi Pygame could not support the buffer protocol on CPython.<br /><br />A possible solution to the first issue is for PyPy to use an extended array interface that includes a PEP 3118 like buffer release callback. I am working to resolve the second issue: <a href="http://bugs.python.org/issue13797" rel="nofollow">[Issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers</a>.<br /><br />[1] <a href="https://bitbucket.org/pygame/pygame/issue/173/add-pep-3118-new-buffer-support-to-pygame" rel="nofollow">Add PEP 3118 (new) buffer support to Pygame surfaces</a>Anonymoushttps://www.blogger.com/profile/14859969972578296875noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-11029489707006477552013-12-10T10:30:32.385+01:002013-12-10T10:30:32.385+01:00@Rene: if pysdl2 is a bare-metal ctypes wrapper, w...@Rene: if pysdl2 is a bare-metal ctypes wrapper, writing a similar cffi wrapper instead should be very straightforward (even more than the current pygame-cffi). But do you know if pygame is really going that route, and if so, how soon?Armin Rigohttps://www.blogger.com/profile/06300515270104686574noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-723011043368642112013-12-09T20:16:52.037+01:002013-12-09T20:16:52.037+01:00@Anonymous - your comment is pretty loaded, but we...@Anonymous - your comment is pretty loaded, but we do think cffi is better than ctypes on all platforms, that's why we came up with cffi in the first place. I think cffi FAQ contains an answer to that.Maciej Fijalkowskihttps://www.blogger.com/profile/11410841070239382771noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-13636596052544900132013-12-09T19:56:50.151+01:002013-12-09T19:56:50.151+01:00Amazing - you consider a messy cffi implementation...Amazing - you consider a messy cffi implementation (sometimes it builds on platform X, sometimes it does not, sometimes it works, sometimes it does not) a better choice over ctypes?<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-83079977172354890412013-12-09T18:09:36.086+01:002013-12-09T18:09:36.086+01:00Ah, ok. Very nice work anyway. It's impressi...Ah, ok. Very nice work anyway. It's impressive what you all managed to get done in the sprint :)<br /><br />Here's some information from pygame land about where the project is heading.<br /><br />SDL 1 is the past, and the SDL developers are no longer putting out releases. However, I think many people will continue to patch it up for many years. SDL 2 is the future and after many years finally has a release out (2 now). pysdl2 is part of the future of pygame. pysdl2 matches the SDL 2 API as closely as possible. A pygame API ontop of pysdl2 is the future of pygame.<br /><br />ctypes is no good for some platforms like iOS, and the web and pypy apparently. Although note, that pysdl2 already 'works' on top of pypy.<br /><br />https://bitbucket.org/marcusva/py-sdl2/<br />http://pysdl2.readthedocs.org/en/latest/<br /><br /><br />Happy hacking :)René Dudfieldhttps://www.blogger.com/profile/17762358075557755436noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-86974780150806027752013-12-09T17:19:28.405+01:002013-12-09T17:19:28.405+01:00first of all pygame depends on SDL 1. Second ctype...first of all pygame depends on SDL 1. Second ctypes kinda suck and I don't quite buy it's stability (especially with changing APIs, though it can be less of an issue with SDL). It's also slow on pypyMaciej Fijalkowskihttps://www.blogger.com/profile/11410841070239382771noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-934791200660490602013-12-09T15:21:03.695+01:002013-12-09T15:21:03.695+01:00Why not use the ctypes based pysdl2?Why not use the ctypes based pysdl2?René Dudfieldhttps://www.blogger.com/profile/17762358075557755436noreply@blogger.com