Life of a Clojure Expression
summary
Follows one map literal from source through the reader, analyzer, bytecode emitter and runtime, showing that a two-key map becomes a persistent array map (<=8 entries) and that constant keys are emitted as static constants, the compiler calls RT.mapUniqueKeys and emits ASM bytecode via ASM so HotSpot can inline the size checks. Relies on Compiler.java (8500+ lines) and shows the compiled class extending AFunction with a single invoke method returning the constructed map.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:20Disclaimers
- 4:14Lisp Breeder Java
- 4:42Map Reader
- 7:05Eval
- 10:16Macro Expand
- 23:56Static Method Invocation
related talks
42mData All The ASTs
35mWhat Lies Beneath - A Deep Dive Into Clojure's Data Structures
19mCompile-Time Java Stream Fusion via mapMulti
16mCompile-Time Java Stream Fusion via mapMulti
39mClojureScript
25m“A Semi Compile/Run-time Map with (Nearly) Zero Overhead Lookup”
34mHash Maps: more room at the bottom
44mThe Dawn of Lisp, or How to Write Eval and Apply in Clojure
