Data All The ASTs
summary
Shows that Clojure compilers store ASTs as nested hash maps via tools.analyzer and split JVM specifics into tools.analyzer.jvm and an emitter library; analyzer nodes include op, form, children (a children vector that encodes execution order) and environment with namespaces and loop ids. Demonstrates building an emitter that pretty-prints s-exprs, a constant folder that evaluates whitelisted VARs at compile time, and a map optimizer that splits literal maps; passes compose with comp, run via post-walk, and the examples work end-to-end on core.async and ClojureScript-derived code.
AI-written summary · about
chapters (32)
- 0:00Introduction
- 0:55Three phases of a compiler
- 2:12Read eval
- 2:49Closure Compiler
- 3:41Internal ASTs
- 4:14Kaleidoscope
- 4:42Dotnet
- 6:39If
- 8:16Children
- 9:21Required ASTs
- 11:29History of Compilers
- 13:14JVM Analyzer
- 15:54Closure Emitter
- 19:12Local Shadowing
- 20:45Open Dispatching
- 21:33Creating a Constant Folder
- 22:59Filtering Statements
- 23:58Filtering Variables
- 25:33Reo
- 26:01Invoke
- 28:21Comp
- 29:40CoreAsync
- 31:19Tools Analyzer
- 34:03Static Single Assignment
- 34:42Questions
- 35:23Macros
- 36:20Anchor
- 37:08Vector
- 37:27Analyzers
- 38:54Reporting Closer To A New Runtime
- 39:38Not Formally Defined
- 41:36Asynchronous Nodes
related talks
40mLife of a Clojure Expression
29mThe ClojureScript Compiler - A Look Behind the Curtains
01h 04mClojure Compilation, Backwards
27mAST Meta-programming
10mA quick view into a compiler
29mMy Little Parser: Tooling is Magic
37mThe Elixir parser under the microscope
44mJavaScript AST programming: Introduction and beyond
