JavaScript module system: exploring the design space

Junhee Cho, Sukyoung Ryu
{"title":"JavaScript module system: exploring the design space","authors":"Junhee Cho, Sukyoung Ryu","doi":"10.1145/2577080.2577088","DOIUrl":null,"url":null,"abstract":"While JavaScript is one of the most widely used programming languages not only for web applications but also for large projects, it does not provide a language-level module system. JavaScript developers have used the module pattern to avoid name conflicts by themselves, but the prevalent uses of multiple libraries and even multiple versions of a single library in one application complicate maintenance of namespace. The next release of the JavaScript language specification will support a module system, but the module proposal in prose does not clearly describe its semantics. Several tools attempt to support the new features in the next release of JavaScript by translating them into the current JavaScript, but their module semantics do not faithfully implement the proposal. In this paper, we identify some of the design issues in the JavaScript module system. We describe ambiguous or undefined semantics of the module system with concrete examples, show how the existing tools support them in a crude way, and discuss reasonable choices for the design issues. We specify the formal semantics of the module system, which provides unambiguous description of the design choices, and we provide its implementation as a source-to-source transformation from JavaScript with modules to the plain JavaScript that the current JavaScript engines can evaluate.","PeriodicalId":357928,"journal":{"name":"Proceedings of the 13th international conference on Modularity","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-04-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 13th international conference on Modularity","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2577080.2577088","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

Abstract

While JavaScript is one of the most widely used programming languages not only for web applications but also for large projects, it does not provide a language-level module system. JavaScript developers have used the module pattern to avoid name conflicts by themselves, but the prevalent uses of multiple libraries and even multiple versions of a single library in one application complicate maintenance of namespace. The next release of the JavaScript language specification will support a module system, but the module proposal in prose does not clearly describe its semantics. Several tools attempt to support the new features in the next release of JavaScript by translating them into the current JavaScript, but their module semantics do not faithfully implement the proposal. In this paper, we identify some of the design issues in the JavaScript module system. We describe ambiguous or undefined semantics of the module system with concrete examples, show how the existing tools support them in a crude way, and discuss reasonable choices for the design issues. We specify the formal semantics of the module system, which provides unambiguous description of the design choices, and we provide its implementation as a source-to-source transformation from JavaScript with modules to the plain JavaScript that the current JavaScript engines can evaluate.
JavaScript模块系统:探索设计空间
虽然JavaScript是最广泛使用的编程语言之一,不仅用于web应用程序,也用于大型项目,但它没有提供语言级别的模块系统。JavaScript开发人员已经使用模块模式来避免名称冲突,但是在一个应用程序中普遍使用多个库,甚至单个库的多个版本,使名称空间的维护变得复杂。JavaScript语言规范的下一个版本将支持模块系统,但是以散文形式提出的模块建议并没有清楚地描述其语义。有几个工具试图通过将新特性翻译成当前的JavaScript来支持下一个JavaScript版本中的新特性,但是它们的模块语义并没有忠实地实现提议。在本文中,我们确定了JavaScript模块系统中的一些设计问题。我们用具体的例子描述了模块系统的模糊或未定义的语义,展示了现有工具如何以粗略的方式支持它们,并讨论了设计问题的合理选择。我们指定模块系统的形式化语义,它提供了对设计选择的明确描述,并且我们将其实现作为从带有模块的JavaScript到当前JavaScript引擎可以计算的纯JavaScript的源到源转换。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信