Abstract
Optional typing is traditionally viewed as a compromise between static and dynamic type checking, where code without type annotations is not checked until runtime. We demonstrate that optional type annotations in Dart programs can be integrated into a flow analysis to provide static type safety guarantees both for annotated and non-annotated parts of the code. We explore two approaches: one that uses type annotations for filtering, and one that uses them as specifications. What makes this particularly challenging for Dart is that its type system is unsound even for fully annotated code. Experimental results show that the technique is remarkably effective, even without context sensitivity: 99:3% of all property lookup operations are reported type safe in a collection of benchmark programs.
Original language | English |
---|---|
Title of host publication | DLS 2016 - Proceedings of the 12th Symposium on Dynamic Languages |
Editors | Roberto Ierusalimschy |
Number of pages | 12 |
Publisher | Association for Computing Machinery |
Publication date | 1 Nov 2016 |
Pages | 1-12 |
ISBN (Print) | 978-1-4503-4445-6 |
ISBN (Electronic) | 9781450344456 |
DOIs | |
Publication status | Published - 1 Nov 2016 |
Event | SPLASH 2016: Systems, Programming, and Applications - Amsterdam, Netherlands Duration: 30 Oct 2016 → 4 Nov 2016 http://2016.splashcon.org/ |
Conference
Conference | SPLASH 2016 |
---|---|
Country/Territory | Netherlands |
City | Amsterdam |
Period | 30/10/2016 → 04/11/2016 |
Internet address |
Keywords
- Optional types
- Static analysis
- Type systems