faster-cpython / ideas

1.67k stars 49 forks source link

We need a design for the DSL-based code generator #497

Closed gvanrossum closed 1 year ago

gvanrossum commented 1 year ago

Mark made some good points: we need to design the code generator as a compiler. I'm not quite sure what the IL (or ILs) should look like. After GH-99526 and GH-99495 have landed I will start thinking about this for real, probably while converting some more families to the non-legacy format. (Doing the conversions is very helpful in forming the right ideas.)

gvanrossum commented 1 year ago

Actually, I misunderstood Mark's comment. The key part is that we have a standard way to read instruction definitions, and we do, in Tools/cases_generator, in the form of the Analyzer class in generate_cases.py. Things could be factored out slightly better, but the basic framework is there and we'll refactor as needed. So I'm going to close this as "done" (or close enough).