Jack Williams, J. Garrett Morris, P. Wadler, Jakub Zalewski
{"title":"Mixed Messages: Measuring Conformance and Non-Interference in TypeScript","authors":"Jack Williams, J. Garrett Morris, P. Wadler, Jakub Zalewski","doi":"10.4230/LIPIcs.ECOOP.2017.28","DOIUrl":null,"url":null,"abstract":"TypeScript participates in the recent trend among programming \nlanguages to support gradual typing. The DefinitelyTyped Repository \nfor TypeScript supplies type definitions for over 2000 popular \nJavaScript libraries. However, there is no guarantee that \nimplementations conform to their corresponding declarations. \n \nWe present a practical evaluation of gradual typing for TypeScript. \nWe have developed a tool for use with TypeScript, based on the \npolymorphic blame calculus, for monitoring JavaScript libraries and \nTypeScript clients against the TypeScript definition. We apply our \ntool, TypeScript TPD, to those libraries in the DefinitelyTyped \nRepository which had adequate test code to use. Of the 122 libraries \nwe checked, 62 had cases where either the library or its tests \nfailed to conform to the declaration. \n \nGradual typing should satisfy non-interference. Monitoring a program \nshould never change its behaviour, except to raise a type error \nshould a value not conform to its declared type. However, our \nexperience also suggests serious technical concerns with the use of \nthe JavaScript proxy mechanism for enforcing contracts. Of the 122 \nlibraries we checked, 22 had cases where the library or its tests \nviolated non-interference.","PeriodicalId":172012,"journal":{"name":"European Conference on Object-Oriented Programming","volume":"27 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-06-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"16","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"European Conference on Object-Oriented Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.ECOOP.2017.28","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 16
Abstract
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.