Write a Blog >>

TypeScript participates in the recent trend among programming languages to support gradual typing. The DefinitelyTyped Repository for TypeScript supplies type definitions for over 2000 popular JavaScript libraries. However, there is no guarantee that implementations conform to their corresponding declarations.

We present a practical evaluation of gradual typing for TypeScript. We have developed a tool for use with TypeScript, based on the polymorphic blame calculus, for monitoring JavaScript libraries and TypeScript clients against the TypeScript definition. We apply our tool, TypeScript TPD, to those libraries in the DefinitelyTyped Repository which had adequate test code to use. Of the 122 libraries we checked, 62 had cases where either the library or its tests failed to conform to the declaration.

Gradual typing should satisfy non-interference. Monitoring a program should never change its behaviour, except to raise a type error should a value not conform to its declared type. However, our experience also suggests serious technical concerns with the use of the JavaScript proxy mechanism for enforcing contracts. Of the 122 libraries we checked, 22 had cases where the library or its tests violated non-interference.

Fri 23 Jun

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change

13:40 - 15:20
Language and Library DesignECOOP Research Papers at Auditorium, Vertex Building
Chair(s): Sophia Drossopoulou Imperial College London
13:40
25m
Talk
IceDust 2: Derived Bidirectional Relations and Calculation Strategy Composition
ECOOP Research Papers
Daco Harkes Delft University of Technology, Eelco Visser Delft University of Technology
Link to publication DOI Media Attached
14:05
25m
Talk
Mixed Messages: Measuring Conformance and Non-Interference in TypeScript
ECOOP Research Papers
Jack Williams University of Edinburgh, J. Garrett Morris University of Edinburgh, UK, Philip Wadler University of Edinburgh, UK, Jakub Zalewski
Link to publication Media Attached
14:30
25m
Talk
EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse
ECOOP Research Papers
Weixin Zhang University of Hong Kong, Bruno C. d. S. Oliveira The University of Hong Kong
Link to publication Media Attached
14:55
25m
Talk
Data exploration through dot-driven development
ECOOP Research Papers
Tomas Petricek Alan Turing Institute
Link to publication Media Attached