cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
jcea has quit [Ping timeout: 250 seconds]
<fijal> ctismer: hi Christian!
<ctismer> fijal: Good morning
<ctismer> cfbolz: yes, I was wondering how to do this at all. It is tightly integrated with CPython and refcounting.
<cfbolz> ctismer: we emulate refcounting quite well for c extensions
<ctismer> Currently, I break things like a Mandelbrot program into Gui and computation. The computation task is PyPy and accelerates by 10, very nice.
<cfbolz> ctismer: did you ever try to build pyside with PyPy and see what fails?
<ctismer> cfbolz: ok, then I should try it. - no, I didn’t. Hey why did I not try!
<cfbolz> There will likely be errors, but I am curious about the first one
<ctismer> Ok, will try to use PyPy for building PySide6 today and see what happens.
<ctismer> PySide with PyPy would really be the burner !
<ctismer> One good thing is that we use the Limited API, already. So the whole macro crap is already solved.
<ctismer> Probably I was blocked by this old article from Victor Stinner:
<cfbolz> ctismer: ah, great!
oberstet has joined #pypy
lritter has joined #pypy
<ctismer> cfbolz: After some hassles to let us find the library, it started to compile.
<ctismer> cfbolz: But can it be that PyPy does not support Py_LIMITED_API ?
<ctismer> I get problems with defining it and without.
<cfbolz> ctismer: I don't know, it's a question for mattip, who's on vacation
simpson has quit [Ping timeout: 258 seconds]
simpson has joined #pypy
<ctismer> cfbolz: OK, I will hack a bit and try to skip the macros that we both implement ;)
<cfbolz> ctismer: cool :-). maybe we can open an issue to track the problems a bit?
<cfbolz> ctismer: given that there is an issue about it, seems the limited api is indeed not supported at this point: https://foss.heptapod.net/pypy/pypy/-/issues/3327
jcea has joined #pypy
<ctismer> cfbolz: Well, we have already an old one on PySide that I will revive, but probably redirecting to PyPy?
<cfbolz> sounds like a plan!
<ctismer> The limited API is then not THAT problem, since I implemented it for PySide. Good to know!
<ctismer> Are macro defs in PyPython compatible with the C versions?
<cfbolz> mostly they should be
<ctismer> ok then I'll use the limited api, but change the support to undef macros that should not exist.
<cfbolz> ctismer: sometimes we use functions instead of macros though
<cfbolz> so undef might not work
<ctismer> yes, we too! And when you use functions, then it is probably crucial to use them?
<ctismer> Well, I will see, after all they are not so many.
<ctismer> Is there a simple way to see if I'm PyPy? (did not load the sources, yet, but if it's promising...)
<cfbolz> ctismer: from C?
<cfbolz> PYPY_VERSION should be defined
<cfbolz> from python, we import __pypy__ and check whether it exists
<ctismer> that would be great. No, some PyPy call from CMake would be ok, I already looked into sys.
<ctismer> thakk you, that saves time.
<ctismer> Funny: PyPy does not define PyObject_IS_GC
<cfbolz> ctismer: small stuff like that can just be added, I think (it would always return 1 on pypy?)
<ctismer> yep, I also do not need it any more, just a left-over from Qt 5.15
<ctismer> cfbolz: A few more functions are missing, but it begins to build!
<cfbolz> ctismer: cool, again, we can add them to pypy, too
<cfbolz> ctismer: thanks for working on it :-)
<ctismer> sure! Let me just try if I get far enough and it makes sense. I will open an issue when I know enough.
<ctismer> I would reeeeaaaaaaally love to have PyPy with PySide. That would benefit both projects :)
<ctismer> cfbolz: If it's really only about having everything generate correctly, it might work!
<ctismer> cfbolz: There is no Py_Initialize. Can I ignore this, or am I messing up?
<cfbolz> ctismer: I don't know 😅
<cfbolz> ctismer: If I understand correctly, embedding is not so well supported in PyPy
<ctismer> uahh
lritter has quit [Ping timeout: 265 seconds]
oberstet has quit [Quit: Leaving]
Daetalus has joined #pypy
<Daetalus> Hello!
<Daetalus> I had read a twitter said "unicode-utf8 just got merged! Unicode strings are now internally represented as utf-8 in PyPy, with an optional extra index data structure to make indexing O(1). We'll write a blog post about it eventually.
<Daetalus> I didn't find such a blog post. I wonder if there have any resources to describe how unicode-utf8 was implemented in PyPy besides the source code?
<Daetalus> Thank you!