Closed gvanrossum closed 1 year ago
Implementing superinstructions as A + JOIN + B
probably make sense, but I'd rather have the DSL be explicit about superinstructions.
Parsing superinstructions should be simple. Do we gain much by removing that code?
Implementing superinstructions as
A + JOIN + B
probably make sense, but I'd rather have the DSL be explicit about superinstructions.
I guess we could rename JOIN to SUPER, would that be explicit enough?
Parsing superinstructions should be simple. Do we gain much by removing that code?
You can see for yourself in https://github.com/python/cpython/pull/100124/commits/eadca5182a47d30324e6a8da6471a061165c665d. That commit removes about 80 lines net, or about 6% of the generator and parser. About 60 lines are removed from the generator, about 20 from the parser proper.
See also https://github.com/faster-cpython/ideas/issues/495 which asks a related question.
FWIW after reading Brandt's review of the cpython PR I'm rather hesitant about this.
Off-line we decided not to do this.
This can now be expressed as a macro using A + JOIN + B.
See also python/cpython#100124 and #507.