Generate the interpreter
Overview
Over in faster-cpython/ideas we've been exploring the idea of generating the interpreter from a set of instruction definitions. This will eventually enable having multiple versions of the interpreter (e.g. with and without tracing enabled), and it will allow us to automatically combine instructions using a powerful notation (e.g. super(LOAD_FAST__LOAD_FAST) = LOAD_FAST + LOAD_FAST;). It will also let us auto-generate things like stack_effect().
We are planning to land at least an early version of this work in 3.12. We have a tentative grammar for instruction definition DSL -- which will undoubtedly undergo several iterations before we've settled. We have a first draft of the tooling ~ready for review (which currently reproduces the status quo)~ done.
Once the first version of the tooling has landed we expect to iterate quickly, using this issue an umbrella issue for our PRs to link to.
References
- https://github.com/faster-cpython/ideas/issues/5
- https://github.com/faster-cpython/ideas/issues/16
- https://github.com/faster-cpython/ideas/issues/454
- https://github.com/faster-cpython/ideas/issues/477
- https://github.com/faster-cpython/ideas/issues/479
- https://github.com/faster-cpython/ideas/issues/481
- PR: gh-98830
- PR: gh-99065
- PR: gh-99084
- PR: gh-99093
- PR: gh-99102
- PR: gh-99107
- PR: gh-99120
- PR: gh-99271
- PR: gh-99313