Mixed Messages: Measuring Conformance and Non-Interference in TypeScript

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.
混合信息:在TypeScript中度量一致性和非干扰性
TypeScript参与了编程语言中支持渐进式类型的最新趋势。TypeScript的DefinitelyTyped Repository为2000多个流行的JavaScript库提供了类型定义。但是,不能保证实现符合其相应的声明。我们给出了TypeScript渐进类型的一个实际评估。基于多态责备演算,我们开发了一个与TypeScript一起使用的工具,用于根据TypeScript定义监控JavaScript库和TypeScript客户端。我们将TypeScript TPD工具应用到DefinitelyTyped Repository中那些有足够测试代码可用的库中。在我们检查的122个库中,有62个库或其测试不符合声明。渐进式输入应满足不干扰。监视程序不应该改变其行为,除非在值与其声明的类型不一致时引发类型错误。然而,我们的经验也表明,使用JavaScript代理机制来执行契约存在严重的技术问题。在我们检查的122个库中,有22个库或其测试违反了不干扰性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信