Content area
JavaScript is arguably today’s most popular programming language, and it is ubiquitous as the “language of the web”. It is dynamically typed, meaning that programmers do not write type annotations, and beyond this it also has a nonrestrictive dynamic semantics. This makes it easy for programmers to write code that runs, though determining if the code is correct or efficient is an entirely different story. Concretely, JavaScript’s dynamism renders sound and precise static analysis of the language extremely difficult. This complicates the development of tooling for JavaScript which could help programmers write correct and efficient code.
Sound and precise analysis of JavaScript is beyond the state of the art, and in this thesis we explore the effectiveness of using unsound analysis to build tools to detect and remediate inefficiencies in asynchronous JavaScript programs. We explore the following thesis statement: Unsound analysis of asynchronous JavaScript applications yields actionable insights and effective optimizations. We support this statement with four approaches to detect and remediate sub-optimal anti-patterns in various application domains. Promising results in all cases suggest that perfect is the enemy of good, and that unsound approaches are viable and useful for improving JavaScript code.