Expeditious Code via Inference
summary
ClojureScript now uses improved type inference to emit leaner JavaScript: unchecked ifs and direct logical operators replace cljs.core.truth checks when booleans are inferred; string coercion elision removes unnecessary .toString joins; return type inference lets the analyzer warn on e.g. adding numbers to strings. Experiments show specialization and direct field lookup yield big speedups (examples: 10–6,300% and 66–450%), rest/param inference and externs inference reduce runtime checks, and REPL rebinding can still produce stale-optimized code.
AI-written summary · about
chapters (28)
- 0:00Expeditious Code
- 0:54VOUCH
- 1:08Intro & Rationale
- 2:29Definitions
- 4:08History
- 5:14Overview
- 6:28Macro-Functions
- 9:16Checked if
- 11:00Logic
- 13:00String Coercion Elision
- 15:06Perf Measurement
- 17:00CLJS Type System
- 17:44The Type System
- 20:34Type Canonicalization
- 21:44Type Hinting
- 24:35Return Type Inference
- 26:02Predicate-Induced
- 27:24loop / recur Widening
- 30:20Calcification
- 32:38Compiler Perf
- 34:34Experiments
- 34:45Specializations
- 35:43Direct Field Lookup
- 36:52Rest Args
- 37:33Parameter Type Inference
- 39:47Interacting with Closure
- 40:32Other Uses
- 42:27Summary








