cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
witran has quit [Quit: Page closed]
witran has joined #pypy
mwhudson has quit [Remote host closed the connection]
mwhudson has joined #pypy
mwhudson has quit [Changing host]
mwhudson has joined #pypy
rubdos has quit [Ping timeout: 252 seconds]
_whitelogger has joined #pypy
speeder39 has quit [Quit: Connection closed for inactivity]
dddddd has quit [Remote host closed the connection]
_whitelogger has joined #pypy
w80 has joined #pypy
w80 has quit [Remote host closed the connection]
AnitoxMN has joined #pypy
AnitoxMN has quit [Remote host closed the connection]
mockKl has joined #pypy
mockKl has quit [Remote host closed the connection]
cleeoI has joined #pypy
cleeoI has quit [K-Lined]
null4bl3KV has joined #pypy
CandleSp has joined #pypy
null4bl3KV has quit [Remote host closed the connection]
CandleSp has quit [Ping timeout: 272 seconds]
redj_ has joined #pypy
redj_ has left #pypy [#pypy]
redj has quit [Disconnected by services]
redj has joined #pypy
themsay has quit [Ping timeout: 272 seconds]
oberstet has joined #pypy
oberstet has quit [Excess Flood]
oberstet has joined #pypy
Zaab1t has joined #pypy
the_drow has joined #pypy
<the_drow> Nice work on the latest cpyext update
<the_drow> I do have some questions that weren't answered in the blog post
<mattip> the_drow: thanks
<mattip> the_drow: it's IRC, just ask
<the_drow> Couldn't we provide a macro redefinition of Py_INCREF and Py_DECREF that simply ignores reference counting and interacts with our GC directly?
<the_drow> Extensions shouldn't use it by default but can if they don't rely on the refcounting behaviour to release resources
<the_drow> This can be especially helpful for Cython extensions which can generate such code
<mattip> the_drow: what would "interact directly" mean? It would just push the problem elsewhere
<mattip> since the concept of "scope" does not exist in C
<the_drow> I mean, it will not use refcounting at all which is one of the problems we have with cpyext as far as I recall
Zaab1t has quit [Ping timeout: 252 seconds]
<mattip> so what would it use instead?
<the_drow> Because we have a GC that can allocate objects much faster
<the_drow> I suggest that Py_INCREF will simply add the object to the nursury if it's not already there
<the_drow> and Py_DECREF will be a noop since the GC already tracks what objects needs to be released
<mattip> but how does the GC track things that are managed opaquely in C, it cannot know when it is safe to release.
<the_drow> Well, if an object is only managed in C than we have a problem
<mattip> yes, that is the problem exactly. It is managed via C and then passed into the interpreter
<mattip> We don't want to always get involved for each malloc/free since sometimes the code doesn't reach the interpreter at all
<the_drow> Because we create the bridge view object lazily right?
<mattip> yup, only when calling a c-api that forces rpython interaction
<mattip> so the idea to make it fast is to minimize those crossing points in either direction
<mattip> if possible, what is written in C should stay in C
<the_drow> Another question I had is why don't we trace the execution of instructions, write the appropriate bytecodes for them in our VM and interact with the C code only when it does not invoke cpyext
<the_drow> Essentially turning a cpyext extension to CFFI
<the_drow> I'm aware that what I'm suggesting isn't easy
<the_drow> But hey, you guys haven't done easy in quite a while :P
Zaab1t has joined #pypy
<mattip> not sure I follow - "trace the execution of instructions" - of compiled C code?
<mattip> we have toyed with the thought of changing cython to do something along those lines, but not at the C level, at the python level
oberstet has quit [Remote host closed the connection]
<mattip> on another note, has anyone toyed with mypyc https://github.com/JukkaL/mypyc
<mattip> "Mypyc is a compiler that aims to eventually compile mypy-annotated, statically typed Python modules into Python C extensions"
<mattip> it seems to be a dropbox project, from what I can gather
<kenaan> mattip default 80ba133be397 /rpython/rlib/: add, test LoadLibraryW, LoadLibraryEx{A, W}
<kenaan> mattip cffi_dlopen_unicode ec14b51b9207 /pypy/module/_cffi_backend/test/test_re_python.py: add failing test
<mattip> arigato (for the logs): it seems the "fsencode_or_none" unwrap spec on desc_dlopen should be relaxed,
<mattip> and we should expose a dlopenU from rlib.rdynload that would call into LoadLibraryW
<mattip> I think that would fix the failing test I added in 80ba133be397
<fijal> the_drow: it's hard, there is something like that for ruby
<fijal> that follows assembler/C in order to understand what's going on
<fijal> but C lacks some key metrics, like lifetime of objects
dddddd has joined #pypy
<kenaan> mattip default 8894e5f1d5c0 /: Use LoadLibraryEx in loading extension modules, like CPython's _PyImport_FindSharedFuncptr
the_drow has quit [Read error: Connection reset by peer]
_whitelogger has joined #pypy
moei has quit [Quit: Leaving...]
speeder39 has joined #pypy
<kenaan> mattip cffi_dlopen_unicode 9093671404b4 /: allow unicode filename in W_DlOpenLibObject
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4148 [mattip: force build, cffi_dlopen_unicode]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4148 [mattip: force build, cffi_dlopen_unicode]
<mattip> cffi on cpython uses ctypes.CDLL(libname) to open a shared object. This does not use LoadLibraryEx on windows
<mattip> so if the dll needs to load a dll in the same directory, it must be added to the PATH
moei has joined #pypy
Frankablu has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
<kenaan> arigo py3.5 000e19254270 /lib_pypy/_cffi_ssl/_stdssl/__init__.py: #2900 fix in the _ssl module with poll()
lritter has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
speeder39 has quit [Quit: Connection closed for inactivity]
<_aegis_> what does INCREF currently do in cpyext?
<_aegis_> I was wondering about batching it and scanning that with the gc
<_aegis_> like C just writes a log of inc/dec to a log page, and pypy linear scans that and turns any >0 back into references when doing gc pass
<_aegis_> (assuming right now inc/dec cross the boundary)
<LarstiQ> _aegis_: did you read anto's blogpost?
<mattip> _aegis_: they are implemented like in CPython in pypy/module/cpyext/include/object.h
<mattip> the fast version is pure C, but Py_DECREF might call _Py_Dealloc() if ob_refcnt drops to 0
witran has quit [Ping timeout: 256 seconds]
<_aegis_> yes I was thinking about thus because of the blogpost. I skimmed it before piping up again but didn't see that detail
<_aegis_> I also can't tell from the blogpost if Py_Dealloc was a huge bottleneck or not
<_aegis_> my core point still stands. because it's a GC, it doesn't matter *when* you dealloc, so you might as well batch
<_aegis_> one could dealloc each time a py->c function returns, or keep a long-lived C-side datastructure that pypy consumes when it does a normal GC
<_aegis_> (your Py_Objects could have an extra pointer size off one end, and you could embed link dealloced ones together for example)
<_aegis_> though I assume you want to get rid of the Py_Object before then so you could also keep a dense array of dead references in C
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
<kenaan> mattip cffi_dlopen_unicode 7013b39caaa8 /pypy/module/_cffi_backend/cdlopen.py: rework to fix win32 translation
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4149 [mattip: force build, cffi_dlopen_unicode]
Kronuz has quit [Remote host closed the connection]
<mattip> _aegis_: Py_Dealloc is not yet a bottleneck, but that was the point of the blogpost
<mattip> at this point there are many things to work on and not alot of resources to do them. We could use help or funding
<mattip> bye for now
mattip has left #pypy ["Leaving"]
jacob22__ has quit [Ping timeout: 268 seconds]
<kenaan> mattip cffi_dlopen_unicode da2aa8584393 /pypy/module/_cffi_backend/cdlopen.py: fix for non-win32
<_aegis_> my project depends heavily on pypy and I will definitely try to contribute code at some point :)
<_aegis_> these discussions are helping me understand it better
jacob22__ has joined #pypy
xorAxAx has left #pypy [#pypy]
xorAxAx has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4149 [mattip: force build, cffi_dlopen_unicode]
<sh4rm4^bnc> wait, you aren't a pypy developer, _aegis_ ?
<_aegis_> I build and ship pypy with a real world app, and have spent some time getting familiar with pypy internals
<_aegis_> I have not yet contributed code upstream but I've been making local changes and experiments for a while
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 272 seconds]
Zaab1t has quit [Quit: bye bye friends]
nedbat has quit [Quit: ZNC - http://znc.in]
nedbat has joined #pypy
jacob22__ has quit [Read error: Connection reset by peer]
nedbat has quit [Remote host closed the connection]
jacob22__ has joined #pypy
nedbat has joined #pypy
danieljabailey has quit [Quit: ZNC 1.6.5+deb2build2 - http://znc.in]
danieljabailey has joined #pypy
lritter has quit [Ping timeout: 268 seconds]