Journal article
Type Inference for Static Compilation of JavaScript
SIGPLAN notices, v 51(10), pp 410-429
01 Oct 2016
Featured in Collection : UN Sustainable Development Goals @ Drexel
Abstract
We present a type system and inference algorithm for a rich subset of JavaScript equipped with objects, structural subtyping, prototype inheritance, and first-class methods. The type system supports abstract and recursive objects, and is expressive enough to accommodate several standard benchmarks with only minor workarounds. The invariants enforced by the types enable an ahead-of-time compiler to carry out optimizations typically beyond the reach of static compilers for dynamic languages. Unlike previous inference techniques for prototype inheritance, our algorithm uses a combination of lower and upper bound propagation to infer types and discover type errors in all code, including uninvoked functions. The inference is expressed in a simple constraint language, designed to leverage off-the-shelf fixed point solvers. We prove soundness for both the type system and inference algorithm. An experimental evaluation showed that the inference is powerful, handling the aforementioned benchmarks with no manual type annotation, and that the inferred types enable effective static compilation.
Metrics
9 Record Views
Details
- Title
- Type Inference for Static Compilation of JavaScript
- Creators
- Satish Chandra - Samsung Research, USAColin S. Gordon - Drexel UniversityJean-Baptiste Jeannin - Samsung Research, USACole Schlesinger - Samsung Research, USAManu Sridharan - Samsung Research, USAFrank Tip - Northeastern UniversityYoungil Choi - Samsung
- Publication Details
- SIGPLAN notices, v 51(10), pp 410-429
- Publisher
- Assoc Computing Machinery
- Number of pages
- 20
- Resource Type
- Journal article
- Language
- English
- Academic Unit
- Computer Science
- Web of Science ID
- WOS:000393581000024
- Other Identifier
- 991019168121504721
UN Sustainable Development Goals (SDGs)
This publication has contributed to the advancement of the following goals:
InCites Highlights
Data related to this publication, from InCites Benchmarking & Analytics tool:
- Collaboration types
- Industry collaboration
- Domestic collaboration
- International collaboration
- Web of Science research areas
- Computer Science, Software Engineering