Embracing Black Magic: The Power of Code Transpilation
summary
Claim: source-to-source transformers rewrite code by operating on the AST and can be composed as visitors to do real runtime things. Examples show using Babel and TypeScript and the CoffeeScript compiler; a sandbox demo transpiles every expression into a validate call and throws on forbidden strings, and an instrumenting demo injects line-dispatch calls to visualize and pause execution. Source maps are used to map back, and generators/parsers like Babylon are the actual tools that make it work.
AI-written summary · about
chapters (13)
- 0:00Start
- 0:53Front End Development and magical thinking
- 3:52Source-to-source compiler
- 4:25Continuous code transformation during the build process
- 5:35Source Maps
- 6:55Rebellion against reality
- 7:05The end of the "lowest common factor" mentality
- 9:57CoffeeScript
- 10:28TypeScript
- 18:46Abstract Syntax Tree (AST)
- 22:21Composite transpilers
- 30:54Ordinary part of the build process
- 31:06Creative technique and strategy
related talks
20mJavaScript Transformation
31mThe Different Transformation Stages of AOT Compilers
36mTransformers - codemods in disguise
28mFantastic ASTs and where to find them
27mParsing, Compiling, and Static Metaprogramming
29mMy Little Parser: Tooling is Magic
05mReact to Code
33mHidden Gems of TypeScript compiler
