Gradual Typing for a More Pure JavaScript
Typ
Examensarbete på kandidatnivå
Program
Publicerad
2019
Författare
ERLANDSSON, JAKOB
NYGREN, ERIK
VIGREN, OSKAR
WESTBERG, ANTON
Modellbyggare
Tidskriftstitel
ISSN
Volymtitel
Utgivare
Sammanfattning
Dynamically typed languages have surged in popularity in recent years, owing totheir flexibility and ease of use. However, for projects of a certain size dynamictyping can cause problems of maintainability as refactoring becomes increas-ingly difficult. One proposed solution is the use of gradual type systems, wherestatic type annotations are optional. This results in providing the best of bothworlds. The purpose of this project is to create a gradual type system on topof JavaScript. Another goal is to explore the possibility of making guaranteesabout function purity and immutability using the type system. The types andtheir relations are defined and a basic type checker is implemented to confirmthe ideas. Extending type systems to be aware of side effects makes it easier towrite safer software. It is concluded that all of this is possible and reasonableto do in JavaScript.