3 ms·
I'd like to credit abarnert for starting the wordcode changes: https://github.com/abarnert/cpython/tree/wpy https://github.com/abarnert/cpython/tree/wpy We were
by __s 10y ago
I'd like to credit abarnert for starting the wordcode changes: https://github.com/abarnert/cpython/tree/wpy https://github.com/abarnert/cpython/tree/wpy
We were discussing for a bit & then he went silent. Haven't heard from him since
I kind of stepped in, rewrote the peepholer, & then initiated the python dev discussion earlier than he wanted to. He wanted to develop the idea & benchmark it in a bubble, whereas I really felt that this should be developed with feedback from core Python developers. Serhiy was very patient with me, there was a lot of feedback it turns out
Fun little issue that thankfully got caught last month: http://bugs.python.org/issue28782 http://bugs.python.org/issue28782 (I had thought about this error case, but at the time I had lasti being -2 & the first byte of the bytecode is never 72. I forgot this constraint when having lasti be -1 still)
- SloopJon 10y agoThe bytecode interpreter I test has over a thousand instructions, because much of the standard library functions are baked in. I asked a colleague whether it made sense to convert to wordcode. He thought it might: simpler decoding, less branching, and easier alignment. I think code size would go up, but not by much. Really interesting to see this come to Python. Thanks for mentioning it.
- sandGorgon 10y agoI didn't know what you meant...until I saw this The Python interpreter now uses a 16-bit wordcode instead of bytecode which made a number of opcode optimizations possible. (Contributed by Demur Rumed with input and reviews from Serhiy Storchaka and Victor Stinner in issue 26647 and issue 28050.)