Closed almarklein closed 4 years ago
Just wanted to show my support: this is really impressive :)
Almost there ...
sigh in Python 3.8 there have been some changes to the bytecode: The interpreter loop has been simplified by moving the logic of unrolling the stack of blocks into the compiler. The compiler emits now explicit instructions for adjusting the stack of values and calling the cleaning-up code for break, continue and return.
Removed opcodes BREAK_LOOP, CONTINUE_LOOP, SETUP_LOOP [...]
That SETUP_LOOP
was really useful for us to tell that a loop was coming, but that info is now gone :'(
Yeah... it's a risk of relying on internals :(
It may help to ask support from core devs on what opcodes would be best to use, since they may keep changing this even further
I don't think that's necessary. The loop structure can still be derived from the jumps, and is actually not that much different from what the code does now. It's mostly that the SETUP_LOOP and POP_BLOCK gave us a nice signal, and now we have to evaluate the bytecode a bit harder. I've made a start, and I have a good feeling about it.
🥳
From a high pov:
x = .. if .. else ..
)op_select
instead of control flow~ -> too complexx**2
)neg
andnot
.and
andor
.%
modulo operator.Implementation:
or
to meet requirements of SpirV branching.or
logic. If I make a mistake here, it will cause someone a lot of tears.co_binop
(it feels a bit too shorntened)._op_jump_if_true_or_pop
-> raises an error with a (more or less) friendly error message.