Oh You Who Enter, Abandon All Hope
summary
Explains how programming languages are implemented with a focus on Python and CPython: syntax, grammar, and abstract syntax trees (ASTs). Shows practical techniques for modifying Python code via its AST (with examples like pytest and 2to3), describes an informal way to extend Python’s grammar using a custom codec, and outlines how to change the actual Python grammar by creating a modified interpreter.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:25Code to execution journey
- 3:55Modifying grammar with operators
- 6:00Context-free grammar and state
- 8:49Context-sensitive languages and Python
- 10:54Python’s formal grammar and implementation
- 13:42Deterministic finite automata in Python
- 16:30SLL(1) grammar constraints
- 18:34Python design technical decisions
- 21:43Practical operator implementation
- 23:11Technical decisions consequences
- 25:18Summary
related talks
32mCode as Data_ A Practical Introduction to Python’s Abstract Syntax Tree
24mThe AST and Me
36mHacking the Python AST
22mDecoding: programming beyond text files
27mDigging into Abstract Syntax Trees for analyzing and modifying Python programs
30mDemystifying Python’s Internals: Diving into CPython by implementing...
31mUnderstanding Python from the inside: C concepts to dive into CPython fearless
17mUnlocking Python's AST: The Metaprogramming Superpower You Didn't Know You Had
