[Python-ideas] Adding a frame evaluation API to CPython
ncoghlan at gmail.com
Mon May 16 23:49:17 EDT 2016
This idea generally sounds reasonable to me, I just have some
suggestions for other folks to approach specifically for feedback.
On 17 May 2016 at 06:19, Dino Viehland <dinov at microsoft.com> wrote:
> Other JITs
> It should be mentioned that the Pyston team was consulted on an earlier version of this PEP that was more JIT-specific and they were not interested in utilizing the changes proposed because they want control over memory layout they had no interest in directly supporting CPython itself. An informal discusion with a developer on the PyPy team led to a similar comment.
> Numba https://github.com/Microsoft/Pyjion/blob/master/pep.rst#numba, on the other hand, suggested that they would be interested in the proposed change in a post-1.0 future for themselves https://github.com/Microsoft/Pyjion/blob/master/pep.rst#numba-interest.
Hopefully Victor will chime in anyway, but if he doesn't, I'd suggest
asking him directly what impact this proposal might have on the
bytecode transformation aspects of PEP 511.
There also seems to be a potential overlap with the function
specialisation proposal in PEP 510, so it would be good to see this
PEP discussing its relationship with that one (the explanation may be
"they're orthogonal proposals addressing different concerns", but it
isn't immediately obvious to me that that's actually the case)
> In conversations with the Python Tools for Visual Studio team (PTVS) https://github.com/Microsoft/Pyjion/blob/master/pep.rst#ptvs, they thought they would find these API changes useful for implementing more performant debugging. As mentioned in the https://github.com/Microsoft/Pyjion/blob/master/pep.rst#rationale section, this API would allow for switching on debugging functionality only in frames where it is needed. This could allow for either skipping information that sys.settrace() normally provides and even go as far as to dynamically rewrite bytecode prior to execution to inject e.g. breakpoints in the bytecode.
I'd suggest reaching out directly to Dave Malcolm on the GNU tools
team in relation to this aspect, as I believe he did a lot of the work
for the improved CPython runtime support in gdb 7+:
That support currently mostly works at the frame level, so it would be
interesting to know what additional capabilities might be enabled by
being able to selectively intercept code execution at the bytecode
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas