Pipe-ifying Python: The how and why of interpreter hacking
summary
Adds a concrete pipe operator to CPython by changing token and grammar files, rewriting the parse rule to be recursive, and lowering pipes into normal call nodes so translation and runtime need no new opcodes. The patch is small: +38 −2 lines (generated boilerplate larger). Edits touch grammar/python and Grammar/tokens, plus a short AST transform; unparse via ast.unparse produces plain Python without pipes for compatibility. Demo uses built CPython so examples actually run.
AI-written summary · about
chapters (8)
- 0:00Motivation and goals
- 5:54Interpreter internals 101
- 8:25Tokenizing new operators
- 10:42Parsing the syntax tree
- 13:35Grammar implementation
- 18:34Implicit translation
- 22:05Live demonstration
- 23:04Ecosystem impact and outlook
related talks
30mDemystifying Python’s Internals: Diving into CPython by implementing...
27mCPython's Compilation Pipeline
36mHacking the Python AST
34mCompiling Pythons with Custom Grammar for the sake of a joke
27mOh You Who Enter, Abandon All Hope
28mHere be dragons: some elegant and ugly hacks in CPython
38mDynamic Code Instrumentation with Hacked Interpreters
02h 26mPointers in Python
