Skip to content

Commit

Permalink
File interpreter_definition.md moved back
Browse files Browse the repository at this point in the history
  • Loading branch information
efimov-mikhail committed Oct 14, 2024
1 parent 0bfc54d commit 748b53c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions InternalDocs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ List of topics:

[Frames](frames.md)

[Bytecode Interpreter](bytecode_interpreter.md)

[Adaptive Instruction Families](adaptive.md)

[The Source Code Locations Table](locations.md)
Expand Down
2 changes: 1 addition & 1 deletion Tools/cases_generator/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tooling to generate interpreters

Documentation for the instruction definitions in `Python/bytecodes.c`
("the DSL") is [here](https://github.com/python/cpython/blob/main/InternalDocs/bytecode_interpreter.md).
("the DSL") is [here](interpreter_definition.md).

What's currently here:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ The presence of these macros and the nature of bytecode interpreters means
that the interpreter is effectively defined in a domain specific language (DSL).

Rather than using an ad-hoc DSL embedded in the C code for the interpreter,
a custom DSL is defined. This DSL defines the semantics of the bytecode instructions.
a custom DSL should be defined and the semantics of the bytecode instructions,
and the instructions defined in that DSL.

Generating the interpreter decouples low-level details of dispatching
and error handling from the semantics of the instructions, resulting
Expand All @@ -52,10 +53,11 @@ to be written. One way to mitigate this is through the use of code generators.
Code generators decouple the debugging of the code (the generator) from checking
the correctness (the DSL input).

New interpreter for the tier 2 optimizer is added in CPython 3.13.
That interpreter have a different API, a different set of instructions and
different dispatching mechanism. But the instructions it interpret are built
from the same building blocks as the instructions for the tier 1 (PEP 659) interpreter.
For example, we are likely to want a new interpreter for the tier 2 optimizer
to be added in 3.12. That interpreter will have a different API, a different
set of instructions and potentially different dispatching mechanism.
But the instructions it will interpret will be built from the same building
blocks as the instructions for the tier 1 (PEP 659) interpreter.

Rewriting all the instructions is tedious and error-prone, and changing the
instructions is a maintenance headache as both versions need to be kept in sync.
Expand Down

0 comments on commit 748b53c

Please sign in to comment.