tag:blogger.com,1999:blog-3971202189709462152.post8679802461301121984..comments2024-03-11T12:50:02.036+01:00Comments on PyPy Status Blog: pygame_cffi: pygame on PyPyCarl Friedrich Bolz-Tereickhttp://www.blogger.com/profile/00518922641059511014noreply@blogger.comBlogger41125tag:blogger.com,1999:blog-3971202189709462152.post-12415651840742564302015-01-24T16:22:41.583+01:002015-01-24T16:22:41.583+01:00I came up with a funny idea about why not making e...I came up with a funny idea about why not making emscripten generates code targeted on RPython, then now we can use C/C++ in PyPy directly? A LLVM to RPython compiler, how about this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-34984602902945154732014-04-16T12:50:51.993+02:002014-04-16T12:50:51.993+02:00Maybe indeed :-)Maybe indeed :-)Armin Rigohttps://www.blogger.com/profile/06300515270104686574noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-68211959693827592132014-04-15T15:09:01.336+02:002014-04-15T15:09:01.336+02:00@Arne: I've now submitted a bug on the PyPy Bu...@Arne: I've now submitted a bug on the PyPy Bug tracker (Issue 1736), with more detail etc. Probably best to move conversation on any Pyglet related issues over there.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-71595376368396679732014-04-15T12:35:23.673+02:002014-04-15T12:35:23.673+02:00@Arne: It's as simple as running the Astraea e...@Arne: It's as simple as running the Astraea example in Pyglet and pressing a key (under PyPy 2.2, Pyglet 1.2-beta, Ubuntu 14.04). As far as I remember, this has been the case for some time (at least as far back as Ubuntu 12.10/PyPy 2.0 beta - although back then the major issue was PyPy using a lot more CPU; I didn't report this then due to a blog post at the time saying how cTypes would be rewritten). The error reported by Apport is "Cannot access memory at address 0x20"<br /><br />Doing a cursory scan through other examples, the noisy and text_input examples also have problems. noisy segfaults when a spawned ball collides with a boundary (occasionally giving a partial rpython traceback); text_input appears to have a random chance of any of the input boxes being selectable.<br /><br />Maybe it's time to file a proper bug report on this...Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-28977052826955314062014-04-10T10:06:24.886+02:002014-04-10T10:06:24.886+02:00@David: Can you give some more background on the e...@David: Can you give some more background on the error (how to get the code, how to reproduce the segfault)?ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-45143109589861896732014-04-10T10:05:42.968+02:002014-04-10T10:05:42.968+02:00@David: That is a really important feedback to Arm...@David: That is a really important feedback to Armin and and Anatoly, I think.ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-88701809204787671552014-04-09T15:30:38.487+02:002014-04-09T15:30:38.487+02:00@Arne: In principal, PyPy seems to handle Pyglets ...@Arne: In principal, PyPy seems to handle Pyglets chained functions relatively well (non-scientifically running the Astraea examples title screen sees CPU usage start very high, but eventually drops to about 80% of cPythons after the JIT warms up). There is one caveat preventing better testing: the moment keyboard input is given to Astraea on PyPy, PyPy segfaults.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-19187494716604958062014-04-09T12:47:42.498+02:002014-04-09T12:47:42.498+02:00@Armin: You’re right… actually I would be pretty i...@Armin: You’re right… actually I would be pretty interested, though, whether pypy also has a performance issue with pyglet's chained functions.ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-83404633754977505172014-04-08T05:47:38.822+02:002014-04-08T05:47:38.822+02:00I'd like to remind readers of these comments t...I'd like to remind readers of these comments that this thread has gone farther and farther from both the original post and the whole blog -- which is supposed to be related to PyPy. I'm rather sure that you're now discussing performance on CPython, which in this case is very different from performance on PyPy (or would be if it supported all packages involved). Maybe move this discussion somewhere more appropriate?Armin Rigohttps://www.blogger.com/profile/06300515270104686574noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-65382156108143162402014-04-07T22:26:35.408+02:002014-04-07T22:26:35.408+02:00@Arne:
I'd argue that objects with Z-order wo...@Arne:<br /><br />I'd argue that objects with Z-order would be more convenient programmatically, but frankly that's a matter of opinion. (Incidentally, this is something I'm working on as well, and I think I'm mostly done on it). <br /><br />However, per-object-draw is only one concern I have on Pyglets speed credentials, as I do not believe Pyglet was written with speed as a design goal. For a different example, see pyglet.graphics.vertexbuffer; copying a ctypes object into a list in order to get slices to work is not a smart thing to do, performance wise!<br /><br />I'm not sure where you got Python 3.2 from, but what I meant was that currently I'm restricting myself to OpenGL 3.2, which means that certain older OpenGL functions do not exist. Pyglet uses some of these removed functions (e.g. glPushClientAttrib), and hence the bindings I'm generating at the moment do not provide all the features Pyglet uses.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-14174746579308514442014-04-07T18:25:12.305+02:002014-04-07T18:25:12.305+02:00For Python 3.2 you might find useful stuff in the ...For Python 3.2 you might find useful stuff in the python-3 port of pyglet, though that hasn’t been released, yet, IIRC.ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-13566653526383782682014-04-07T18:23:40.904+02:002014-04-07T18:23:40.904+02:00@David: The per-object draw-method is very conveni...@David: The per-object draw-method is very convenient for programming. As soon as you need more performance, most of the objects are grouped into batches, though. That way only the draw method of the batch is called and the batch can do all kinds of optimizations.ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-36162314328260044212014-04-04T16:26:54.213+02:002014-04-04T16:26:54.213+02:00@Arne: Regarding Pyglet integration - it seems it ...@Arne: Regarding Pyglet integration - it seems it would require a lot of work. There's two major issues - firstly, Pyglet only has raw OpenGL bindings, which are used everywhere and hence the "more pythonic" bindings of gl32 would be hard to integrate without editing every file using GL in Pyglet. Secondly, Pyglet uses GL functions which were removed in 3.2, and hence are not in gl32, so the API generator would have to be extended to handle any special cases on these functions.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-89012682746167024862014-04-04T02:23:38.073+02:002014-04-04T02:23:38.073+02:00@Arne: Maybe it'd be worth looking at integrat...@Arne: Maybe it'd be worth looking at integrating it then; however, it really is a completely different approach - gl32 is a source code writer, whereas Pyglet uses Pythons inbuilt metaprogramming capabilities - and so it would be completely rewriting a large chunk of Pyglets core. Once I've got the binding generator finalised, it might be worth seeing if it's possible to replace Pyglet's OpenGL bindings with these ones.<br /><br />That said, in the interest of full disclosure: I'm not a fan of Pyglets per object draw method, again in the interests of speed. The per object draw method that Pyglet encourages with its API is not very scalable and eliminates a large number of the advantages of using OpenGL. So whilst I might see if gl32 can be plugged in for interesting benchmarks/proof-of-concept, I probably wouldn't try to get it bug-free and integrated into upstream Pyglet.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-23663345882111820492014-04-03T22:09:50.073+02:002014-04-03T22:09:50.073+02:00@anatoly: more specifically, I do not consider int...@anatoly: more specifically, I do not consider intimate moments as cheap (and WTactics has the image, so I could pull this off). Instead I try to rid myself of baseless inhibitions, though that’s not always easy: Killing off no longer needed societal conditioning is among the hardest battles…ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-90715205112769580692014-04-03T22:06:43.711+02:002014-04-03T22:06:43.711+02:00@anatoly: I like kissing elves ☺ (and when I get t...@anatoly: I like kissing elves ☺ (and when I get to write the next part of the story, I intend to keep them as player characters: That someone starts out in an intimate moment does not mean he or she is watchmeat).<br /><br />@David: I guess modifying core-code in pyglet is not that big of a problem, especially *because* it is mostly being maintained right now: Little danger of breaking the in-progress work of someone else.ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-62070239024831258122014-04-03T16:58:51.724+02:002014-04-03T16:58:51.724+02:00@anatoly
Pyglet's GL wrapper generator create...@anatoly<br /><br />Pyglet's GL wrapper generator creates a lot of chained functions (fairly slow in cPython). I'm also not sure if there's enough development activity in Pyglet to allow modifying core code, and given the size of the Pyglet project I'm not going to fork it. PyOpenGL has more or less the same issues.<br /><br />Regal appears to be a very large project (a 68MB checkout), which has a scope much greater than just its wrapper generator - the sheer scope of the project does cause some barriers to entry. I'm still looking through, but I am fairly certain that it would take more effort to adapt Regals binding generator than I have expended on my own.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-27802825849156699702014-04-03T11:39:41.130+02:002014-04-03T11:39:41.130+02:00@Arne, kissing elves trick is low. =) Otherwise lo...@Arne, kissing elves trick is low. =) Otherwise looks wesnothy and 2D. I don't see why it should use OpenGL. 3D models would be cool.<br /><br />I'd try to make it run on PySDL2 with "from sdl2.ext.api import pyglet". There is no pyglet API there, but would be interesting to see if it is possible to provide one.anatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-11187216396846353382014-04-03T11:36:12.140+02:002014-04-03T11:36:12.140+02:00Sorry, the correct link is https://github.com/p3/r...Sorry, the correct link is https://github.com/p3/regal/tree/master/scriptsanatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-14904353393163962072014-04-03T11:35:15.308+02:002014-04-03T11:35:15.308+02:00@David, I am speaking about OpenGL specific wrappe...@David, I am speaking about OpenGL specific wrapper generators. I've added information to this page - https://www.opengl.org/wiki/Related_toolkits_and_APIs#OpenGL_loading_libraries<br /><br />The OpenGL generator in Python is included in regal project here https://github.com/p3/regal/scripts<br /><br />pyglet also has one.anatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-35738717935799301492014-04-03T08:28:32.257+02:002014-04-03T08:28:32.257+02:00@anatoly: pyglet seems to be in maintenance mode r...@anatoly: pyglet seems to be in maintenance mode right now. There are commits every few days, but only small stuff.<br /><br />On the other hand I understand that: pyglet supplies everything a backend for a game-engine needs (I use it¹), so the next step should be to use it for many games and see whether shared needs arise.<br /><br />¹: See http://1w6.org/deutsch/anhang/programme/hexbattle-mit-zombies and https://bitbucket.org/ArneBab/hexbattle/ArneBabhttps://www.blogger.com/profile/16449390422848764481noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-3925541193373589092014-04-02T16:39:25.712+02:002014-04-02T16:39:25.712+02:00@anatoly
I never claimed my project is a replacem...@anatoly<br /><br />I never claimed my project is a replacement for PyOpenGL - it's not API compatible, for a start. Regarding license, it'll probably get changed for the bindings at some point, probably to 3-clause BSD.<br /><br />On the wrapper generator: Really, the only actively maintained wrapper generator for Python that I'm aware of (which isn't project specific) is SWIG, which is not appropriate (at the very least, googling for 'python wrapper generator -swig' doesn't seem to give many results). In any case, the wrapper generator isn't a lot of code.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-9072115685217453192014-04-02T16:08:16.396+02:002014-04-02T16:08:16.396+02:00@David, why reinvent the wheel? There are many wra...@David, why reinvent the wheel? There are many wrapper generators around. Also, you project is not a replacement for PyOpenGL, because of GPL restrictions.anatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-58446106990955043002014-04-02T15:57:08.864+02:002014-04-02T15:57:08.864+02:00@anatoly techtonick:
Actually, it'll end up on...@anatoly techtonick:<br />Actually, it'll end up on Launchpad in the near future (probably within 2 weeks?). However, it's the output of a wrapper generator and the wrapper generator is in pretty poor shape at the moment, in terms of packaging it's output. I just figured people might be able to use it in the near future, even if it is in 'source-code-dump' form. If there's a better temporary home for it somewhere, I'm all ears.Davidhttps://www.blogger.com/profile/10583791127808594589noreply@blogger.comtag:blogger.com,1999:blog-3971202189709462152.post-13348427466536210452014-04-02T15:38:14.358+02:002014-04-02T15:38:14.358+02:00@David, if you want people to comment on this, Bit...@David, if you want people to comment on this, Bitbucket would be a better way to share sources than Dropbox.anatoly techtonikhttps://www.blogger.com/profile/07847778636782899903noreply@blogger.com