Conditional Execution of Transpiler Passes Based on Per-Script Feature Detection
Rishipal Singh Bhatia

TL;DR
This paper introduces a method for conditionally executing transpiler passes in JavaScript compilers based on real-time feature detection, significantly reducing compilation time and resource usage.
Contribution
It presents a novel approach to dynamically track language features during transpilation, enabling selective pass execution in the Google Closure Compiler.
Findings
Reduced compilation time in large-scale projects
Decreased compute and memory usage
Maintained feature-correctness during transpilation
Abstract
As the ECMAScript specification evolves, industrial-scale JavaScript compilers face the challenge of supporting modern language syntax while maintaining compatibility for diverse execution environments. Traditionally, compilers solve this by running transpilation passes in a monolithic pipeline, where the transpilation passes are chosen to execute strictly based on a target language level. This results in significant computational waste, as compilers perform expensive Abstract Syntax Tree (AST) traversals to lower features that may not exist in the actual input source code. We present a compiler improvement that conditionally executes transpiler passes based on accurately tracking and dynamically maintaining the exact set of language features present in the compilation unit throughout the transpilation process. It is implemented in the production Google Closure Compiler. By populating…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Parallel Computing and Optimization Techniques · Security and Verification in Computing
