Skip to content

M3 The front end #22

Description

@tamnd

Roughly eight weeks. Lessons F01 through F12, source text to code object. This is where the first of CPython's three machine readable self specifications gets taught properly: the PEG grammar generates the parser, and ASDL generates the AST.

Exit criterion. BP-CODEOBJ is complete enough that a reader implements a line table and exception table decoder in a language of their choice, from the blueprint alone, and it agrees with CPython across the whole standard library. Tested by actually having someone do it, not by opinion. compile_explorer is live and diffs 3.13, 3.14 and 3.15.

Content

  • F01 through F12: the tokenizer, f strings, the PEG parser, the AST, the symbol table, the code generator, the CFG, the optimizer, the assembler, code objects, line and exception tables, and marshal

Blueprints

  • BP-TOK, BP-FSTR, BP-GRAMMAR, BP-AST, BP-SYMTAB, BP-CFG, BP-CODEOBJ, BP-MARSHAL

Artifacts

  • The compile_explorer app with multi version diffing
  • Golden corpora for tokens, ast, symtable, bytecode, linetable, exctable and marshal

Gates

  • Whether Tools/peg_generator can run in the browser on a toy grammar, which decides whether F03 is a live experiment or a recording

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/milestoneA milestone checklist, tracking the issues that close itpriority/p1Needed for the current milestone but not blocking today

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions