首页 > 最新文献

Proceedings of the 12th ACM SIGPLAN International Symposium on Scala最新文献

英文 中文
Safe object initialization, abstractly 抽象地说,安全对象初始化
Pub Date : 2021-10-17 DOI: 10.1145/3486610.3486895
Fengyun Liu, O. Lhoták, Enze Xing, Nguyen Cao Pham
Objects under initialization are fragile: some of their fields are not yet initialized. Consequently, accessing those uninitialized fields directly or indirectly may result in program crashes or abnormal behaviors at runtime. A newly created object goes through several states during its initialization, beginning with all fields being empty until all of them are filled. However, ensuring initialization safety statically, without manual annotation of initialization states in the source code, is a challenge, due to aliasing, virtual method calls and typestate polymorphism. In this work, we introduce a novel analysis based on abstract interpreters to ensure initialization safety. Compared to the previous approaches, our analysis is simpler and easier to extend, and it does not require any user annotations. The analysis is inter-procedural, context-sensitive and flow-insensitive, yet it has good performance thanks to local reasoning and heap monotonicity.
处于初始化状态的对象是脆弱的:它们的一些字段尚未初始化。因此,直接或间接访问这些未初始化的字段可能会导致程序崩溃或运行时的异常行为。新创建的对象在初始化过程中会经历几种状态,从所有字段都为空开始,直到所有字段都被填充。然而,由于混叠、虚拟方法调用和类型状态多态性,在源代码中不手动注释初始化状态的情况下,静态地确保初始化安全是一项挑战。在这项工作中,我们引入了一种新的基于抽象解释器的分析来确保初始化的安全性。与前面的方法相比,我们的分析更简单,更容易扩展,而且不需要任何用户注释。该分析具有过程间、上下文敏感和流不敏感的特点,但由于局部推理和堆单调性,具有良好的性能。
{"title":"Safe object initialization, abstractly","authors":"Fengyun Liu, O. Lhoták, Enze Xing, Nguyen Cao Pham","doi":"10.1145/3486610.3486895","DOIUrl":"https://doi.org/10.1145/3486610.3486895","url":null,"abstract":"Objects under initialization are fragile: some of their fields are not yet initialized. Consequently, accessing those uninitialized fields directly or indirectly may result in program crashes or abnormal behaviors at runtime. A newly created object goes through several states during its initialization, beginning with all fields being empty until all of them are filled. However, ensuring initialization safety statically, without manual annotation of initialization states in the source code, is a challenge, due to aliasing, virtual method calls and typestate polymorphism. In this work, we introduce a novel analysis based on abstract interpreters to ensure initialization safety. Compared to the previous approaches, our analysis is simpler and easier to extend, and it does not require any user annotations. The analysis is inter-procedural, context-sensitive and flow-insensitive, yet it has good performance thanks to local reasoning and heap monotonicity.","PeriodicalId":401789,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","volume":"30 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125092193","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 3
Safer exceptions for Scala Scala更安全的异常
Pub Date : 2021-10-17 DOI: 10.1145/3486610.3486893
Martin Odersky, Aleksander Boruch-Gruszecki, J. Brachthäuser, Edward Lee, O. Lhoták
We describe a scheme for reflecting exceptions as capabilities in the Scala type system that keeps notational overhead to a minimum and avoids well-known problems with Java's checked exceptions framework. The scheme makes exceptions safer but not fully safe since the capability for throwing an exception may still yet escape its enclosing try block. To address this limitation, we also propose a type system which prevents capabilities from escaping.
我们描述了一个将异常反映为Scala类型系统中的功能的方案,该方案将符号开销保持在最低限度,并避免了Java检查异常框架中众所周知的问题。该方案使异常更安全,但不是完全安全,因为抛出异常的能力仍然可以脱离其封闭的try块。为了解决这个限制,我们还提出了一个类型系统来防止功能转义。
{"title":"Safer exceptions for Scala","authors":"Martin Odersky, Aleksander Boruch-Gruszecki, J. Brachthäuser, Edward Lee, O. Lhoták","doi":"10.1145/3486610.3486893","DOIUrl":"https://doi.org/10.1145/3486610.3486893","url":null,"abstract":"We describe a scheme for reflecting exceptions as capabilities in the Scala type system that keeps notational overhead to a minimum and avoids well-known problems with Java's checked exceptions framework. The scheme makes exceptions safer but not fully safe since the capability for throwing an exception may still yet escape its enclosing try block. To address this limitation, we also propose a type system which prevents capabilities from escaping.","PeriodicalId":401789,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","volume":"36 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127923270","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 9
Implementing path-dependent GADT reasoning for Scala 3 为Scala 3实现依赖路径的GADT推理
Pub Date : 2021-10-17 DOI: 10.1145/3486610.3486892
Yichen Xu, Aleksander Boruch-Gruszecki, L. Parreaux
Generalized Algebraic Data Types (GADT) are a popular programming language feature allowing advanced type-level properties to be encoded in the data types of a program. While Scala does not have direct support for them, GADT definitions can be encoded through Scala class hierarchies. Moreover, the Scala 3 compiler recently augmented its pattern matching capabilities to reason about such class hierarchies, making GADT-based programming practical in Scala. However, the current implementation can only reason about type parameters, but Scala’s type system also features singleton types and abstract type members (collectively known as path-dependent types), about which GADT-style reasoning is also useful and important. In this paper, we show how we extended the existing constraint-based GADT reasoning of the Scala 3 compiler to also consider path-dependent types, making Scala’s support for GADT programming more complete and bringing Scala closer to its formal foundations.
广义代数数据类型(GADT)是一种流行的编程语言特性,它允许在程序的数据类型中编码高级类型级属性。虽然Scala没有对它们的直接支持,但是可以通过Scala类层次结构对GADT定义进行编码。此外,Scala 3编译器最近增强了它的模式匹配功能,以推断此类类层次结构,从而使基于gat的编程在Scala中变得可行。然而,目前的实现只能对类型参数进行推理,但是Scala的类型系统还具有单例类型和抽象类型成员(统称为路径依赖类型),关于这些gadt风格的推理也很有用和重要。在本文中,我们展示了如何扩展Scala 3编译器现有的基于约束的GADT推理,以考虑路径依赖类型,从而使Scala对GADT编程的支持更加完整,并使Scala更接近其形式基础。
{"title":"Implementing path-dependent GADT reasoning for Scala 3","authors":"Yichen Xu, Aleksander Boruch-Gruszecki, L. Parreaux","doi":"10.1145/3486610.3486892","DOIUrl":"https://doi.org/10.1145/3486610.3486892","url":null,"abstract":"Generalized Algebraic Data Types (GADT) are a popular programming language feature allowing advanced type-level properties to be encoded in the data types of a program. While Scala does not have direct support for them, GADT definitions can be encoded through Scala class hierarchies. Moreover, the Scala 3 compiler recently augmented its pattern matching capabilities to reason about such class hierarchies, making GADT-based programming practical in Scala. However, the current implementation can only reason about type parameters, but Scala’s type system also features singleton types and abstract type members (collectively known as path-dependent types), about which GADT-style reasoning is also useful and important. In this paper, we show how we extended the existing constraint-based GADT reasoning of the Scala 3 compiler to also consider path-dependent types, making Scala’s support for GADT programming more complete and bringing Scala closer to its formal foundations.","PeriodicalId":401789,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115770698","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Proceedings of the 12th ACM SIGPLAN International Symposium on Scala 第12届ACM SIGPLAN Scala国际研讨会论文集
{"title":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","authors":"","doi":"10.1145/3486610","DOIUrl":"https://doi.org/10.1145/3486610","url":null,"abstract":"","PeriodicalId":401789,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","volume":"68 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114996654","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Pathless Scala: a calculus for the rest of Scala 无路径Scala: Scala其余部分的演算
Pub Date : 2021-10-17 DOI: 10.1145/3486610.3486894
Guillaume Martres
Recent work on the DOT calculus successfully put core aspects of Scala on a sound foundation, but subtyping in DOT is structural and therefore not easily amenable to studying the parts of Scala that are deeply tied to its nominal subtyping system. On the other hand, the Featherweight Java calculus has proven to be a great basis for studying many aspects of Java and Java-like languages. Continuing this tradition, we present Pathless Scala: an extension of Featherweight Generic Java that closely models multiple inheritance and intersection types as they exist in the Scala language today. We define the semantics of Pathless Scala by erasing it to a simpler calculus in a way that closely models how Scala is compiled to Java bytecode in practice. More than a one-off, we believe that this calculus could be extended to describe many more features of Scala, although reconciling it with DOT remains an open problem.
最近关于DOT演算的工作成功地为Scala的核心方面奠定了坚实的基础,但是DOT中的子类型是结构性的,因此不容易研究Scala中与其名义上的子类型系统密切相关的部分。另一方面,轻量级Java演算已被证明是研究Java和类Java语言的许多方面的良好基础。延续这一传统,我们提出了无路径Scala:轻量级泛型Java的扩展,它紧密地模拟了多重继承和交叉类型,就像它们现在存在于Scala语言中一样。我们通过将其擦除为更简单的演算来定义无路径Scala的语义,以一种紧密模拟Scala在实践中如何编译为Java字节码的方式。这不仅仅是一次性的,我们相信这个演算可以扩展到描述Scala的更多特性,尽管它与DOT的协调仍然是一个开放的问题。
{"title":"Pathless Scala: a calculus for the rest of Scala","authors":"Guillaume Martres","doi":"10.1145/3486610.3486894","DOIUrl":"https://doi.org/10.1145/3486610.3486894","url":null,"abstract":"Recent work on the DOT calculus successfully put core aspects of Scala on a sound foundation, but subtyping in DOT is structural and therefore not easily amenable to studying the parts of Scala that are deeply tied to its nominal subtyping system. On the other hand, the Featherweight Java calculus has proven to be a great basis for studying many aspects of Java and Java-like languages. Continuing this tradition, we present Pathless Scala: an extension of Featherweight Generic Java that closely models multiple inheritance and intersection types as they exist in the Scala language today. We define the semantics of Pathless Scala by erasing it to a simpler calculus in a way that closely models how Scala is compiled to Java bytecode in practice. More than a one-off, we believe that this calculus could be extended to describe many more features of Scala, although reconciling it with DOT remains an open problem.","PeriodicalId":401789,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Symposium on Scala","volume":"31 4 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2021-10-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125869826","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
期刊
Proceedings of the 12th ACM SIGPLAN International Symposium on Scala
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1