antocuni changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "PyPy: the Gradual Reduction of Magic (tm)"
<abrown>
I'm trying to get a better understanding of how RPython decides to do what it does, though; in my mental model, I thought it would get rid of the `if self.debug` entirely but that was not the case
<simpson>
Since the interpreter is a red, the JIT doesn't know. Reds are like parameters passed into the JIT's generated programs; even if a red has an immutable member, the JIT won't assume that it's got a reliably-special value. You could promote(), I think, without any danger of code explosion, since .debug only has two possible values.
dcrosta has quit [Ping timeout: 252 seconds]
mvantellingen has quit [Ping timeout: 252 seconds]
<abrown>
perhaps the interpreter should be a green; it never changes from iteration to iteration... what I struggle with there is that it contains fields that CAN change from iteration to iteration (e.g. nesting and the contents of environment)
Cheery has quit [Ping timeout: 252 seconds]
Cheery has joined #pypy
<simpson>
You can take the interpreter as red and then promote() the code object within. This will compile to code which takes the interpreter as input and then case-switches on the code object.
<simpson>
Or you can move your JIT entrance to be a little more directly calling the code object, and then pass the code object as a green directly.
<simpson>
We ended up doing the latter for Typhon, since it was faster. The downside is that we can't JIT certain kinds of loops, but those loops are extremely rare (our optimizer can't emit them in any case!) so I'm willing to take that hit. For now.
mvantellingen has joined #pypy
<abrown>
makes sense; thanks for all your help
<abrown>
I have glanced at Typhon a few times in the last few weeks and it has been pretty helpful
<simpson>
Yeah, it's relatively readable for what it does.