~/talk

Climbing the Abstract Syntax Tree

Talkat Forum PHP 2017 · 2017-10-26..10-27· [compilers-and-language-design]
slides:none on file

PHP 7 replaces direct opcode emission with an AST so the parser decouples from the compiler and the parse+compile step runs 10–15% faster at the cost of some memory which PHP 7’s packed zval mostly offsets. The demo builds a basic PHP math compiler in PHP that lexes, converts to reverse polish, constructs an AST and runs a tiny VM — it works as an educational proof of concept but is not production quality. Tools demonstrated include php-ast extension and PHP-Parser plus better-reflection for static analysis and experimental AST rewriting.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:04How PHP processes code
  3. 3:08Lexer and token generation
  4. 6:42Parser and AST generation
  5. 11:26What is an Abstract Syntax Tree
  6. 14:59Benefits of AST in PHP 7
  7. 18:53Polish and reverse Polish notation
  8. 22:31Building a basic math compiler in PHP
  9. 27:50Creating AST from reverse Polish notation
  10. 29:38Executing the AST with a virtual machine
  11. 31:05Impact of AST on PHP 7 performance
  12. 32:29AST in other programming languages
  13. 33:34Using AST in userland with PHP AST extension
  14. 34:59Modifying AST with err seek extension
  15. 35:42PHP Parser library for AST in PHP
  16. 36:26Better Reflection and AST analysis
  17. 39:55Summary and future of AST in PHP
  18. 40:37Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.