Dynamic type inference for JavaScript
Summary
With this master thesis, we have shown that Dynamic Type Inference is a feasi- ble method for doing type inference for JavaScript. The idea of Dynamic Type Inference is to observe the program at run-time, and generate type constraints from the observations. With these constraints, types for the program can be inferred.
To demonstrate this, we have developed both a formal and practical imple- mentation. Our formal system consists of a core JavaScript language and an instrumented semantics. The semantics collects the constraints and infers the types for us. The types inferred by this system are shown to be sound.
Our practical implementation does the same as our formal system, but works on full JavaScript. We have evaluated this system by running it on the SunSpider benchmark. This resulted in useful types, type errors and type warnings.