cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "the modern world where network packets and compiler optimizations are effectively hostile"
marr has quit [Ping timeout: 255 seconds]
yuyichao_ has joined #pypy
ronan_ has joined #pypy
ronan has quit [Read error: Connection reset by peer]
ronan__ has joined #pypy
ronan_ has quit [Quit: Ex-Chat]
zware has joined #pypy
rokujyouhitoma has joined #pypy
exarkun has quit [Ping timeout: 240 seconds]
exarkun has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
ronan__ has quit [Quit: Ex-Chat]
ronan has joined #pypy
zware has quit [Quit: No Ping reply in 180 seconds.]
zware has joined #pypy
zware has quit [Ping timeout: 255 seconds]
jkbbwr has quit [Remote host closed the connection]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 260 seconds]
lritter_ has joined #pypy
lritter has quit [Ping timeout: 240 seconds]
zware has joined #pypy
exarkun has quit [Ping timeout: 260 seconds]
exarkun has joined #pypy
dmalcolm_ has joined #pypy
marky1991 has quit [Ping timeout: 246 seconds]
pilne has quit [Quit: Quitting!]
ndash has joined #pypy
dmalcolm has quit [Ping timeout: 260 seconds]
ndash_ has quit [Ping timeout: 260 seconds]
bjs has quit [Ping timeout: 260 seconds]
danchr has quit [Ping timeout: 260 seconds]
danchr has joined #pypy
demonimin_ has joined #pypy
demonimin_ has joined #pypy
demonimin_ has quit [Changing host]
john51 has quit [Read error: Connection reset by peer]
john51 has joined #pypy
exarkun_ has joined #pypy
bjs has joined #pypy
marky1991 has joined #pypy
hawkieowl has joined #pypy
demonimin has quit [Ping timeout: 260 seconds]
hawkowl has quit [Ping timeout: 260 seconds]
exarkun has quit [Ping timeout: 260 seconds]
hawkieowl is now known as hawkowl
mattip has quit [Ping timeout: 240 seconds]
marky1991 has quit [Ping timeout: 255 seconds]
mattip has joined #pypy
ArneBab_ has joined #pypy
ArneBab has quit [Ping timeout: 260 seconds]
marky1991 has joined #pypy
zware has quit [Ping timeout: 276 seconds]
zware has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
zware has quit [Quit: No Ping reply in 180 seconds.]
exarkun_ has quit [Ping timeout: 240 seconds]
exarkun has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 255 seconds]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
marky1991 has quit [Ping timeout: 240 seconds]
jamesaxl has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
cwillu has joined #pypy
cwillu has quit [Read error: Connection reset by peer]
jamesaxl has quit [Read error: Connection reset by peer]
cwillu has joined #pypy
jamesaxl has joined #pypy
exarkun has quit [Ping timeout: 260 seconds]
exarkun has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 260 seconds]
cwillu has quit [Remote host closed the connection]
cwillu has joined #pypy
cwillu has quit [Read error: Connection reset by peer]
cwillu has joined #pypy
cwillu has quit [Read error: Connection reset by peer]
oberstet has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
leto_ni has joined #pypy
cwillu has joined #pypy
cwillu has quit [Read error: Connection reset by peer]
infernix has quit [Ping timeout: 276 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
lritter_ has quit [Ping timeout: 276 seconds]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 246 seconds]
jamesaxl has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 248 seconds]
yuyichao_ has quit [Read error: Connection reset by peer]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 246 seconds]
antocuni has joined #pypy
ebarrett has joined #pypy
antocuni has quit [Read error: Connection reset by peer]
antocuni has joined #pypy
exarkun has quit [Ping timeout: 260 seconds]
exarkun has joined #pypy
marr has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 260 seconds]
Tiberium has joined #pypy
infernix has joined #pypy
antocuni has quit [Ping timeout: 260 seconds]
<kenaan> mattip default 9ddefd44f80d /pypy/module/cpyext/api.py: do not change preexisting error when calling c-api functions unsuccessfully tried to write a test, since testing ...
exarkun has quit [Read error: Connection reset by peer]
exarkun has joined #pypy
rokujyouhitoma has joined #pypy
yuyichao_ has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
jamesaxl has joined #pypy
ronan has quit [Ping timeout: 258 seconds]
nimaje1 has joined #pypy
nimaje1 is now known as nimaje
nimaje is now known as Guest51864
marky1991 has joined #pypy
Guest51864 has quit [Ping timeout: 260 seconds]
ebarrett has quit [*.net *.split]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 258 seconds]
jcea has joined #pypy
Rhy0lite has joined #pypy
ebarrett has joined #pypy
ndash has quit [*.net *.split]
MarkMangoba has quit [*.net *.split]
MarkMangoba has joined #pypy
jamesaxl has quit [Ping timeout: 240 seconds]
raynold has quit [Quit: Connection closed for inactivity]
antocuni has joined #pypy
adamholmberg has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 260 seconds]
marky1991 has quit [Ping timeout: 240 seconds]
jamesaxl has joined #pypy
<kenaan> mattip default 37e8eeb5775a /pypy/module/sys/vm.py: document 'default' argument to sys.getsizeof
yuyichao_ has quit [Ping timeout: 240 seconds]
dmalcolm_ is now known as dmalcolm
jkbbwr has joined #pypy
yuyichao_ has joined #pypy
yuyichao_ has quit [Quit: Konversation terminated!]
yuyichao has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 240 seconds]
zware has joined #pypy
ronan has joined #pypy
marky1991 has joined #pypy
yuyichao has quit [Ping timeout: 240 seconds]
cerealized has quit [Quit: cerealized]
ndash has joined #pypy
jamesaxl has quit [Ping timeout: 260 seconds]
<exarkun> pickle._Pickler clearly exists. it exists in the source code. it exists at runtime on translated pypy-3.
gclawes has quit [Quit: leaving]
<exarkun> but if I try to use it in a test the test fails: AttributeError: 'module' object has no attribute '_Pickler'
<antocuni> exarkun: is it an applevel test?
gclawes has joined #pypy
<LarstiQ> different module?
<exarkun> antocuni: I used to know what that means
<exarkun> antocuni: I think so? It's a test written in Python for code written in Python.
<antocuni> applevel tests contain code which is *interpreted* by the PyPy interpreter written in RPython
<exarkun> Sorry, I guess I don't know.
<antocuni> look for example at all the tests in pypy/module/*
<antocuni> there are lots which are inside classes named e.g. "class AppTestRandom"
<fijal> exarkun: how are you running the test?
<exarkun> I see.
<antocuni> exarkun: and they need to specify which modules they want to use
<exarkun> py.test magic.
<exarkun> fijal: How you said :) eg `./pytest.py --capture=no -vvv pypy/module/test_lib_pypy/test_pickle_extra.py`
<exarkun> Why would I write an applevel test instead of (what are the other kinds of tests)?
<exarkun> The pickle module seems to be pure Python on PyPy (with no _pickle "optimization" buddy). Seems like it shouldn't need an applevel test? But how does a test that isn't applevel actually test anything from the PyPy interpreter? Or does it not, it just tests some Python code that ships with PyPy.
<antocuni> uh, I think that test_pickle_extra on "default" is terribly wrong
<fijal> exarkun: right, so pickle is a pure python module (no _pickle)
<antocuni> it does "import pickle", which means that it's testing the pickle module of CPython O_o
<fijal> which means it should ideally be tested just translated
<fijal> exarkun: yeah that test is stupid
<fijal> it might work translated, but that's about it
<fijal> so it the pickle module wrong or some pypy related stuff? do you know?
<fijal> you can use lib-python with pypy-c, if everything is pure-python
<exarkun> no, I have no idea what's broken yet, still working on rewriting the lib-python test.
marky1991 has quit [Remote host closed the connection]
<exarkun> seriously, pypy should have one way to run the test suite.
marky1991 has joined #pypy
<exarkun> all the extra complexity belongs in a test loader/runner that knows how to handle different kinds of things. not on the command line.
<exarkun> okay so I'm tossing the half-ported test and just running the lib-python test directly
rokujyouhitoma has joined #pypy
<exarkun> but I can't run the pypy-c I downloaded via a symlink because then it uses its own stdlib
<exarkun> I guess I should copy it into my checkout instead?
<exarkun> seems like
rokujyouhitoma has quit [Ping timeout: 255 seconds]
<ronan> exarkun: if you make a virtualenv for the nightly and run 'python -m test.test_pickle' from lib-python/3/, it'll run the version in the checkout
jamesaxl has joined #pypy
yuyichao has joined #pypy
<arigato> pypy/module/test_lib_pypy/ is basically a collection of extra tests that are meant to run on top of a translated pypy
<arigato> just like lib-python/3/test/
<arigato> (except with py.test instead of pypy3)
<arigato> (so, that's "pypy3 /path/to/py.test ...")
<arigato> ...ok, no, it's a mess. only half the tests are like that, the other half expects cpython2
<arigato> this directory is just fully bogus in the py3.5 branch
<fijal> exarkun: sorry
<fijal> exarkun: I tend to agree, but we arrived with something and unclear how to deal with it
<fijal> exarkun: you seem to be tripping on the stuff quite a bit :/
<fijal> exarkun: do you want to wait until next week when me and armin sit together and can make a comprehensive plan for you instead?
<exarkun> it's software
tilgovi has joined #pypy
<exarkun> can you actually make a comprehensive plan without writing all of the software?
<fijal> not that comprehensive
<fijal> but somewhat more understandable, maybe
<fijal> there seems to be a lot of implicit knowledge
<exarkun> possibly an understatement.
<fijal> ESPECIALLY when it comes to porting to python3
<fijal> so maybe writing it down would be a decent start?
<exarkun> I think I might as well keep poking at this pickle thing though. I have the test running locally now.
<fijal> ok
<exarkun> But if by some chance I actually finish that, yea, I will wait for more of a hint about what to do next.
<exarkun> fwiw the test_pickle failure seems to come down to `SomeClass.some_class_method is SomeClass.some_class_method` is False instead of True (except of course the _actual_ expression is a lot more complicated). It's not trivially true on cpython any more than it is on pypy. I'm trying to minimize the reproducer so it's at least smaller than `pickle.dumps(SomeClass.some_class_method)` (which is not very small
<exarkun> at all).
<fijal> exarkun: so maybe write a test in test_interpreter that checks if X.some_class_method is X.some_class_method?
<fijal> interpreter/test/test_classes.py likely
<arigato> "X.meth is X.meth" should always be true on pypy
<fijal> arigato: class method even?
<arigato> and false in CPython if X is not a built-in class
<arigato> ah
<arigato> I guess not
<fijal> it's not true on cpython either?
<fijal> I have 3.5.1
<exarkun> Yea, it's not, afaict.
<exarkun> I have 3.5.2+
<exarkun> But pickle logic really wants it to be true, and somehow the way pickle performs the test, it is true on cpython
<fijal> exarkun: so what's the exact thing that's true on cpython?
<exarkun> fijal: I don't know how to express the answer in fewer than about 50 lines of python yet
<fijal> ok
<exarkun> I assume when I get that down to 2 or 3 lines I'll know what to do :)
<fijal> exarkun: if you can remove the pickle from equation that would make it obviously much simpler to write a test :)
<exarkun> yesss
tilgovi has quit [Remote host closed the connection]
<kenaan> fijal extradoc 3cd0a7835f19 /blog/draft/remove-gil.rst: work on paragraphs
<kenaan> arigo extradoc 9e0ef6516b6f /blog/draft/remove-gil.rst: Tweaks
rokujyouhitoma has joined #pypy
<kenaan> rlamy py3.5 ca42f6a90f18 /: hg merge default
rokujyouhitoma has quit [Ping timeout: 246 seconds]
<kenaan> rlamy multiphase fe04b833579b /pypy/module/cpyext/: Check the result of module init functions more carefully; improve tests for this
<exarkun> identity red herring, seems likely this is the cause of the divergence, https://gist.github.com/exarkun/a83cb866b52f6184b7d0da4f845778da
oberstet has quit [Ping timeout: 240 seconds]
<ronan> exarkun: so it's yet another case where our _pickle_support hack gets in the way
<exarkun> It looks that way, I guess (I didn't know it caused problems before though)
<fijal> what's pickle_support hack?
<exarkun> Or it could just be a Python 2 / Python 3 incompatibility that needs dealing with, I guess.
* exarkun checks the Python 2 behavior
<exarkun> fijal: Oh right. Unpossible on CPython 2.
<exarkun> fijal: fijal well there's this /module/_pickle_support/ thing
<exarkun> that's where method_new comes from
<exarkun> Any reason not to change function.py, descr_method__reduce__ to do the same getattr trick as CPython?
<ronan> exarkun: probably not
<kenaan> fijal extradoc a37e8e51e1bc /blog/draft/remove-gil.rst: expand
<ronan> exarkun: we had the same issue with functions, see e8b1e5c2b023 and d775ef7a4405
<kenaan> rlamy multiphase dce989c3370d /: hg merge py3.5
<exarkun> ah
<kenaan> arigo extradoc 20b8371b4615 /blog/draft/remove-gil.rst: More tweaks
<arigato> exarkun: fwiw, it might not be immediately obvious, but if you find problems caused by the fact that pypy has a built-in method __reduce__() where CPython doesn't, feel free to kill that method
<exarkun> good to know
rokujyouhitoma has joined #pypy
raynold has joined #pypy
rokujyouhitoma has quit [Ping timeout: 246 seconds]
yuyichao has quit [Ping timeout: 240 seconds]
yuyichao has joined #pypy
leto_ni has quit [Ping timeout: 276 seconds]
yuyichao has quit [Client Quit]
<raynold> ahh it's a wonderful day
antocuni has quit [Ping timeout: 240 seconds]
leto_ni has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
lritter_ has joined #pypy
jamesaxl has joined #pypy
pilne has joined #pypy
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 240 seconds]
<topi`> hi. Anyone know if there are ppl working on bringing pypy JIT support for aarch64?
<topi`> I've got this nice box on my desk, which has 16 gigabytes of RAM and runs aarch64 code natively, would really love to put it to Real use (ie. run python/pypy)
<simpson> topi`: I think that there has been interest but not much in the way of code contributions. Interested in contributing?
<topi`> how much work is there? the only thing I know about porting is when I did armhf support for ghc (haskell)
<topi`> oh, and it sucked crashing and burning and somebody else did it right.
<topi`> the low level detail always comes to bite you
<simpson> I imagine that most of the work is in the JIT code generator, since that's the part that has to know the CPU's ISA.
<topi`> right
<topi`> well, it *is* similar to arhmf ISA, but of course with 64 bit data width
dustinm has quit [Quit: Leaving]
yuvipanda has quit [Read error: Connection reset by peer]
bendlas has quit [Remote host closed the connection]
dustinm has joined #pypy
<exarkun> what's the execution context of a test method on an AppTest?
yuvipanda has joined #pypy
hawkowl has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
lritter_ has quit [Remote host closed the connection]
rokujyouhitoma has joined #pypy
<arigato> exarkun: AppTests are bizarre, generally speaking
<arigato> you can't access any globals
<arigato> you have a "self" object which is not just an instance of the class
<arigato> it's an app-level object which has an attribute "self.xyz" if the real instance of the class at interp-level has an attribute "self.w_xyz"
rokujyouhitoma has quit [Ping timeout: 276 seconds]
<exarkun> makes an AppTest for pickle tricky I guess since pickle wants to do all kinds of globals interaction
bendlas has joined #pypy
<arigato> right, usually you don't want any AppTest or anything running before translation, which imports the whole pickle module
<arigato> in this case, if you identified a few lines of app-level Python code form the pickle module which fails because of some __reduce__,
<arigato> then you can copy just these few lines inside an AppTest
<arigato> otherwise, if it really takes the whole pickle module to check that,
jamesaxl has quit [Quit: WeeChat 1.8]
<arigato> then well, don't bother with writing an AppTest
<arigato> or write one in the simplest form,
<arigato> e.g. assert not hasattr(myfunc, '__reduce__')
<arigato> with comments that say "# that's needed for pickle"
leto_ni has quit [Remote host closed the connection]
<exarkun> hmm ok, makes sense
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
Rhy0lite has quit [Quit: Leaving]
yuvipanda has quit [Write error: Connection reset by peer]
bendlas has quit [Read error: Connection reset by peer]
marky1991 has quit [Read error: Connection reset by peer]
yuvipanda has joined #pypy
<kenaan> exarkun default c38befdc824e /pypy/interpreter/: Mirror CPython classmethod __reduce__ This makes classmethods pickleable and should fix lib-python/3/test_pickle...
<exarkun> ah what
<exarkun> That's not the branch I was on :/
antocuni has joined #pypy
<exarkun> ugh I'm completely unable to use hg probably
bendlas has joined #pypy
<kenaan> exarkun default 4578b8104495 /pypy/interpreter/: meant for py3.5 branch
<exarkun> did I break the repo? if so, sorry.
<kenaan> exarkun py3.5 d5f42df20932 /pypy/interpreter/: Mirror CPython classmethod __reduce__ This makes classmethods pickleable and should fix lib-python/3/test_pickle.py.
<kenaan> exarkun py3.5 2586878e1a3c /pypy/interpreter/test/test_function.py: A more precise assertion.
rokujyouhitoma has joined #pypy
yuyichao has joined #pypy
rokujyouhitoma has quit [Ping timeout: 255 seconds]
Tiberium has quit [Remote host closed the connection]
<michaelgreene> With cffi, is there an inverse of deref'ing data[0]? i.e. in C, if you have derefed = data[0], &derefed would get you the original pointer type... don't know why I can't seem to figure out how that works in cffi. I am not looking to allocate or copy new data, just acquire a pointer to the existing data.
<arigato> michaelgreene: there is no "&" in cffi. you need to keep a pointer to the data in the first place
<arigato> e.g. if data is of type "int[]", then "data[0]" gives you a plain Python int, so there is no way something like ffi.deref(data[0]) would work
<arigato> you can use ffi.addressof(x) if x is of type "struct" or "union", though
<michaelgreene> if event.x_data prints its type as <cdata 'struct tf_x_data &' 0x6ee86e0>, ffi.addressof(event.x_data) would give me a cdata 'struct tf_x_data *' ?
<arigato> yes
<michaelgreene> oh, perfect, thanks. Yes, I understand the reason the int scenario would not work. Thank you for your help.
<arigato> :-)
ronan_ has joined #pypy
ronan has quit [Read error: No route to host]
ronan_ is now known as ronan
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 248 seconds]
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
adamholmberg has quit [Remote host closed the connection]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 255 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 246 seconds]
marr has quit [Ping timeout: 255 seconds]
rokujyouhitoma has joined #pypy
rokujyouhitoma has quit [Ping timeout: 240 seconds]
antocuni has quit [Ping timeout: 255 seconds]
lritter has joined #pypy