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
dfee has joined #pypy
lritter has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
tbodt has quit [Read error: Connection reset by peer]
tbodt has joined #pypy
tbodt has quit [Ping timeout: 248 seconds]
tonyseek has joined #pypy
<simpson> Hm, what are my options for dynamic field access on RPython objects? I have a doubly-linked datastructure, but I'm not sure how to walk the links on the outside because of polymorphism.
<simpson> There's a note in the literature that the links can be a pair of a pointer and a selector/attribute/name/label/slot to access on the linked object, and that'd work fine in vanilla Python with getattr() and setattr(), but that's not RPython.
<simpson> All of the objects involved have statically-known attributes and layouts. I just don't know which object subclass is going to be at each location.
<simpson> Hmmmm. Okay, I think I know how to hack around this. Sorry for the noise.
dfee has quit [Ping timeout: 265 seconds]
asmeurer has quit [Quit: asmeurer]
asmeurer_ has joined #pypy
Garen has quit [Read error: Connection reset by peer]
Garen has joined #pypy
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
asmeurer_ has joined #pypy
jcea has quit [Remote host closed the connection]
jcea1 has joined #pypy
jcea1 is now known as jcea
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dfee has joined #pypy
lritter_ has joined #pypy
lritter has quit [Ping timeout: 240 seconds]
asmeurer_ has quit [Quit: asmeurer_]
tonyseek has quit [Quit: tonyseek]
dddddd has quit [Remote host closed the connection]
lritter_ has quit [Quit: Leaving]
jamesaxl has quit [Quit: WeeChat 2.1]
asmeurer_ has joined #pypy
tonyseek has joined #pypy
realitix has joined #pypy
realitix has quit [Client Quit]
realitix has joined #pypy
tonyseek has quit [Remote host closed the connection]
tonyseek has joined #pypy
exarkun has quit [Read error: Connection reset by peer]
tonyseek has quit [Remote host closed the connection]
tonyseek has joined #pypy
infernix has quit [Ping timeout: 260 seconds]
exarkun has joined #pypy
infernix has joined #pypy
tonyseek has quit [Ping timeout: 264 seconds]
realitix has quit [Quit: realitix]
realitix has joined #pypy
realitix has quit [Client Quit]
realitix has joined #pypy
realitix has quit [Client Quit]
inad922 has joined #pypy
dfee has quit [Ping timeout: 248 seconds]
lritter has joined #pypy
realitix has joined #pypy
realitix_ has joined #pypy
realitix_ has quit [Client Quit]
realitix_ has joined #pypy
realitix has quit [Ping timeout: 248 seconds]
realitix_ is now known as realitix
dfee has joined #pypy
Khayman has joined #pypy
Hasimir has quit [Ping timeout: 240 seconds]
Khayman is now known as Hasimir
inad922 has quit [Ping timeout: 264 seconds]
lritter has quit [Quit: Leaving]
inad922 has joined #pypy
inad923 has joined #pypy
inad922 has quit [Ping timeout: 240 seconds]
marr has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
jamesaxl has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.1]
antocuni has joined #pypy
jamesaxl has joined #pypy
lesshaste has joined #pypy
<lesshaste> hi
Khayman has joined #pypy
<antocuni> arigato: ping?
Hasimir has quit [Ping timeout: 240 seconds]
Khayman is now known as Hasimir
mcyprian has joined #pypy
energizer has quit [Remote host closed the connection]
lweber1 has quit [Read error: Connection reset by peer]
energizer has joined #pypy
lweber1 has joined #pypy
<mattip> hello
<lesshaste> hi mattip
lazka has joined #pypy
lazka has quit [Quit: Leaving]
energizer has quit [Ping timeout: 240 seconds]
antocuni has quit [Ping timeout: 268 seconds]
MerlinTheWizard has joined #pypy
MerlinTheWise has quit [Ping timeout: 240 seconds]
<cfbolz> mattip: maybe we could ask Hrvoje Nikšić whether he'd be up to implementing some of these cpyext fixes himself?
<mattip> +1, although I would prefer to somehow label some of these PRIVATE and bomb out of c-extension compilation with an error -
<mattip> "use pure python instead"
<mattip> or "some things will never be fast in PyPy, don't do this"
<mattip> is there a "shoot self in foot" emoji?
<cfbolz> mattip: like which ones?
<mattip> Py_ReprEnter, Py_ReprLeave https://docs.python.org/3/c-api/exceptions.html, should be built-in, not callable by users
<mattip> and all the PyMarshal functions
inad923 has quit [Ping timeout: 240 seconds]
<mattip> _PyObject_GC_Malloc - do we want to allow users to link objects to the GC?
<mattip> (that is the only on I did not comment on, I don't know what we should do here)
solarjoe4 has joined #pypy
inad923 has joined #pypy
dfee has quit [Ping timeout: 256 seconds]
antocuni has joined #pypy
raynold has quit [Quit: Connection closed for inactivity]
realitix has quit [Ping timeout: 264 seconds]
realitix has joined #pypy
Rhy0lite has joined #pypy
dfee has joined #pypy
dfee has quit [Ping timeout: 256 seconds]
dddddd has joined #pypy
marky1991 has joined #pypy
<kenaan> cfbolz default b0fdbba6aeab /rpython/jit/metainterp/optimizeopt/info.py: fix a very rare segfault in the JIT, shown by Pycket (neither did I manage to write a test, nor to fix the broken...
mattip has left #pypy ["bye"]
realitix has quit [Quit: realitix]
realitix has joined #pypy
realitix has quit [Client Quit]
realitix has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
<mjacob_> simpson: you could create a new class for each element type
<arigato> antocuni: pong
<mjacob_> simpson: at compile time you have the full power of python
<arigato> simpson: yes, but at run time you have to think it's Java/C#, so no generic things as dynamic attribute names, but instead you might need to make methods and override them in all subclasses. which you can do at compile time semi-automatically
JamJam_kid has joined #pypy
<arigato> mattip (logs): Py_ReprEnter() is part of the CPython API, and there's no reason to forbid it, so let's implement it
<arigato> in this case it can be a bit messy in RPython, so we might as well write it as space.appexec() doing tricks with thread-local objects
<simpson> mjacob_: Yeah, I'm generating a class per element.
<simpson> arigato: Yeah. What I've done is to improvise some 'selector' PBCs which can be used in place of strings for getattr() and setattr().
<arigato> right, makes sense
<arigato> you get a more static language, so when you occasionally need the dynamism you have to reinvent it from scratch yourself
<arigato> every large application contains a limited, slow, awkard, buggy, ... version of Lisp, as the idiom goes
mcyprian has quit [Remote host closed the connection]
solarjoe4 has quit [Quit: Leaving]
<simpson> Yep. I don't even really *want* dynamism. I want to do surgery on a graph of nodes, where all of the nodes are doubly-linked. This means that sometimes I have to ask nodes with unknown types to change their links. And I think that this means that the nodes need to have methods for this changing.
<arigato> classical OOP, as meant by the common OOP languages
igitoor has quit [Ping timeout: 256 seconds]
<simpson> Yes. I feel like I've reimplemented the bottom layers of Smalltalk.
igitoor has joined #pypy
igitoor has joined #pypy
igitoor has quit [Changing host]
<Rotonen> abstract message passing?
<simpson> Yeah. Really I want 'linear graph reduction', but the paper describing it doesn't get into the details of memory layout.
<simpson> They just say 'Each method becomes a C procedure that performs surgery on the run-time working graph' and no details. I guess later they say that 'The C code calls various utilities...to manipulate graph structure', but that's it.
<Rotonen> no idea what exactly you are doing, but take a look at the cuda solutions to the scope as well, maybe there are insights to be had
<Rotonen> there's a lot on graph reductions stemming from cuda and opencl research
<simpson> Yeah, but not on *linear graph* reduction. This seems to be a niche. FWIW I'm reading https://dspace.mit.edu/handle/1721.1/13191 but it is a full-length thesis.
<Rotonen> well, there's the 1972 tarjan paper :P
<simpson> Oh, nice find.
<Rotonen> almost everything in the field cites that, heh, seems i still remembered the year correct as well :-)
<Rotonen> used to do something half related a couple of careers ago
lazka has joined #pypy
<simpson> So yeah, this translates and does stuff: https://gist.github.com/MostAwesomeDude/c9253193ff4796098aeefcb45270c3c1
<simpson> Lines 19-30 are what I ended up going with. It might not interpret fast, but it should JIT alright-ish in the long run.
dfee has joined #pypy
realitix has quit [Quit: realitix]
dfee has quit [Ping timeout: 260 seconds]
<arigato> simpson: a more classical solution follows the visitor pattern. the goal is to have methods called "get_<label name>" on the base class and all subclasses
<arigato> you can still have a generic way to invoke "get_<name>" by defining it in the Selector PBCs: in __init__, attach 'self.get = lambda object: object.get_<name>()'
<arigato> which can be written using getattr() on a constant name, in RPython, i.e.:
<arigato> self.get = lambda object: getattr(object, "get_" + label)()
<arigato> just describing an alternative solution. yours is fine if the unrolling_iterable remains short in practice
<arigato> the advantage of the solution I propose is that it would work if the labels correspond to different RPython types, e.g. ints versus instances
JamJam_kid has quit [Ping timeout: 248 seconds]
<arigato> (at least, assuming you call directly "get_<some_int>()" or have several Selector classes for the different types)
<simpson> arigato: The *only* operations that I'll be doing with these are assignment and querying, and I only need the queries for type discrimination.
<simpson> I totally see where you're going, and yeah, a thicker layer like that would be useful if I needed to keep extending this.
<simpson> This paper doesn't have any vertices with more than, say, five selectors. So that should be fine.
JamJam_kid has joined #pypy
<arigato> yes
jamesaxl has quit [Ping timeout: 276 seconds]
jamesaxl has joined #pypy
tbodt has joined #pypy
inad923 has quit [Ping timeout: 248 seconds]
<antocuni> arigato: did you see my question about the GC yesterday?
<antocuni> (you might have to scroll up a bit, the message is at 5:02)
* cfbolz waves
JamJam_kid has quit [Ping timeout: 264 seconds]
jacob22__ has quit [Quit: Konversation terminated!]
inad923 has joined #pypy
lazka has quit [Quit: Leaving]
bwlang has quit [Quit: bwlang]
<antocuni> cfbolz: hi
marself has joined #pypy
rubdos has joined #pypy
rubdos has quit [Quit: WeeChat 2.0.1]
dfee has joined #pypy
rubdos has joined #pypy
dfee has quit [Ping timeout: 240 seconds]
dfee has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jcea has quit [Quit: jcea]
dfee has quit [Quit: WeeChat 1.9.1]
inad923 has quit [Ping timeout: 256 seconds]
antocuni has quit [Ping timeout: 240 seconds]
tbodt has joined #pypy
tbodt has quit [Client Quit]
asmeurer_ has joined #pypy
inad923 has joined #pypy
asmeurer_ has quit [Ping timeout: 265 seconds]
jacob22__ has joined #pypy
jacob22__ is now known as jacob22
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
tbodt has quit [Client Quit]
tbodt has joined #pypy
tbodt has quit [Client Quit]
energizer has joined #pypy
jacob22 has quit [Ping timeout: 260 seconds]
tbodt has joined #pypy
kipras`away is now known as kipras
tbodt has quit [Client Quit]
tbodt has joined #pypy
energizer has quit [Disconnected by services]
energizer has joined #pypy
energizer has quit [Remote host closed the connection]
tbodt has quit [Ping timeout: 276 seconds]
energizer has joined #pypy
tbodt has joined #pypy
jcea has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
asmeurer_ has joined #pypy
jacob22 has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
nunatak has joined #pypy
tbodt has quit [Ping timeout: 264 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
tbodt has joined #pypy
Rhy0lite has quit [Quit: Leaving]
jacob22 has quit [Ping timeout: 260 seconds]
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
inad923 has quit [Ping timeout: 264 seconds]
JamJam_kid has joined #pypy
jamesaxl has quit [Read error: Connection reset by peer]
lazka has joined #pypy
jamesaxl has joined #pypy
lazka has quit [Client Quit]
raynold has joined #pypy
raynold has quit [Excess Flood]
raynold has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jacob22 has joined #pypy
tbodt has joined #pypy
JamJam_kid has quit [Ping timeout: 265 seconds]
marself has quit [Ping timeout: 240 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
marself has joined #pypy
exarkun has quit [Read error: Connection reset by peer]
tbodt has joined #pypy
jacob22 has quit [Read error: Connection reset by peer]
tbodt has quit [Read error: Connection reset by peer]
jacob22 has joined #pypy
exarkun has joined #pypy
tbodt has joined #pypy
nunatak has quit [Quit: Leaving]
jcea has quit [Ping timeout: 240 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jcea has joined #pypy
marself has quit [Ping timeout: 248 seconds]
marself has joined #pypy
marself has quit [Ping timeout: 240 seconds]
nimaje has quit [Ping timeout: 265 seconds]
marself has joined #pypy
nimaje has joined #pypy
marself has quit [Ping timeout: 248 seconds]
marself has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.1]
lritter has joined #pypy
tbodt has joined #pypy
marr has quit [Ping timeout: 256 seconds]
JamJam_kid has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
marself has quit [Quit: WeeChat 1.9.1]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]