7. Erm ... Before we start ... A patch to fix a quirk in the build process. This has been reported on the bug tracker!
8. An overview of the compiler Tokens Parse Tree AST Bytecode + Data AST + Symtable Tokenizer Parser AST Translation Bytecode Generation Bytecode Optimization Execution Symtable Construction
9. New construct: the “unless” statement unless may_give_you_up: print “never gonna give you up...”
10. Semantics of “unless” Works just like “if not” ... if not would_consider_letting_you_down: print “never gonna let you down...”
11.
12.
13. What does this change affect? Tokens Parse Tree AST Bytecode + Data AST + Symtable Tokenizer Parser AST Translation Bytecode Generation Bytecode Optimization Execution Symtable Construction
14. WTF is a “grammar”? Defines the syntactic structure of the language.
16. So what does a tokenizer do, then? Generates a stream of events for the parser.
17. What does the parser do? Organises tokens into the structure defined by the grammar. This is the “parse tree”.
18.
19. What's affected by this change? Tokens Parse Tree AST Bytecode + Data AST + Symtable Tokenizer Parser AST Translation Bytecode Generation Bytecode Optimization Execution Symtable Construction
20. What's an AST? Similar to a parse tree, but not bound to the syntax “ Abstract Syntax Tree”
21. Why does Python use an AST? Much easier to operate upon an AST than a parse tree.
22. AST reuse New constructs can sometimes be expressed using existing AST nodes ...
23. AST reuse ... so we could implement “unless” using “if” and “not” AST nodes. But then I wouldn't be able to show you the code generator ... Unless (test, body) = If ( Not (test), body)
24.
25. What's affected by this change? Tokens Parse Tree AST Bytecode + Data AST + Symtable Tokenizer Parser AST Translation Bytecode Generation Bytecode Optimization Execution Symtable Construction
26.
27. What about the rest of the compiler? Tokens Parse Tree AST Bytecode + Data AST + Symtable Tokenizer Parser AST Translation Bytecode Generation Bytecode Optimization Execution Symtable Construction