首页 > 最新文献

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

英文 中文
Spark and Scala (keynote) Spark和Scala(主题演讲)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3148042
Reynold Xin
Written mostly in Scala and with over 1000 contributors, Apache Spark has become the de facto standard for big data processing. In this talk, I will review the evolution of Spark for the last seven years and our experience using Scala as the main programming language in a high profile open source project with a distributed team. I will outline language features that we can't live without, and features we wish were designed differently. Last but not least, I will discuss how we at Databricks are leveraging native code to further improve performance.
Apache Spark主要是用Scala编写的,贡献者超过1000人,它已经成为大数据处理的事实上的标准。在这次演讲中,我将回顾Spark在过去七年的发展,以及我们在一个分布式团队的高知名度开源项目中使用Scala作为主要编程语言的经验。我将概述我们不能没有的语言特性,以及我们希望以不同的方式设计的特性。最后,我将讨论Databricks如何利用本机代码进一步提高性能。
{"title":"Spark and Scala (keynote)","authors":"Reynold Xin","doi":"10.1145/3136000.3148042","DOIUrl":"https://doi.org/10.1145/3136000.3148042","url":null,"abstract":"Written mostly in Scala and with over 1000 contributors, Apache Spark has become the de facto standard for big data processing. In this talk, I will review the evolution of Spark for the last seven years and our experience using Scala as the main programming language in a high profile open source project with a distributed team. I will outline language features that we can't live without, and features we wish were designed differently. Last but not least, I will discuss how we at Databricks are leveraging native code to further improve performance.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"37 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116441543","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
Interactive development using the Dotty compiler (tool paper) 使用Dotty编译器进行交互式开发(工具文件)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136012
Guillaume Martres
A programming language is only as good at its tooling. Traditionally, tooling has always been an after-thought of language design since developing good tools take significant development efforts. Dotty is an experimental compiler for what will one day be called Scala 3, and Scala already has established and functional tooling. For Dotty to be seen as a viable alternative to Scala 2, it needs to deliver a developer experience at least as good. In particular, good support for Integrated Development Environments (IDEs) is crucial. In this paper we report our progress on providing IDE support for Dotty.
一门编程语言的好坏取决于它的工具。传统上,工具总是语言设计的事后考虑,因为开发好的工具需要大量的开发工作。Dotty是一个实验性编译器,将来会被称为Scala 3, Scala已经有了成熟的功能工具。为了让Dotty被视为Scala 2的可行替代方案,它需要提供至少和Scala 2一样好的开发体验。特别是,对集成开发环境(ide)的良好支持至关重要。在本文中,我们报告了为Dotty提供IDE支持的进展。
{"title":"Interactive development using the Dotty compiler (tool paper)","authors":"Guillaume Martres","doi":"10.1145/3136000.3136012","DOIUrl":"https://doi.org/10.1145/3136000.3136012","url":null,"abstract":"A programming language is only as good at its tooling. Traditionally, tooling has always been an after-thought of language design since developing good tools take significant development efforts. Dotty is an experimental compiler for what will one day be called Scala 3, and Scala already has established and functional tooling. For Dotty to be seen as a viable alternative to Scala 2, it needs to deliver a developer experience at least as good. In particular, good support for Integrated Development Environments (IDEs) is crucial. In this paper we report our progress on providing IDE support for Dotty.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"10 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114183721","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
Rust-like borrowing with 2nd-class values (short paper) 二类价值的锈迹样借款(短票据)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136010
Leo Osvald, Tiark Rompf
The Rust programming language demonstrates that memory safety can be achieved in a practical systems language, based on a sophisticated type system that controls object lifetimes and aliasing through notions of ownership and borrowing. While Scala has traditionally targeted only managed language runtimes, the ScalaNative effort makes Scala a viable low-level language as well. Thus, memory safety becomes an important concern, and the question bears asking what, if anything, Scala can learn from Rust. In addition, Rust's type system can encode forms of protocols, state machines, and session types, which would also be useful for Scala in general. A key challenge is that Rust's typing rules are inherently flow-sensitive, but Scala's type system is not. In this paper, we sketch one possible method of achieving static guarantees similar to Rust with only mild extensions to Scala's type system. Our solution is based on two components: First, the observation that continuation passing style (CPS) or monadic style can transform a flow-sensitive checking problem into a type-checking problem based on scopes. Second, on a previously presented type system extension with second-class values, which we use to model scope-based lifetimes.
Rust编程语言表明,内存安全可以在一个实用的系统语言中实现,它基于一个复杂的类型系统,该类型系统通过所有权和借用的概念控制对象的生命周期和别名。虽然Scala传统上只针对托管语言运行时,但ScalaNative的努力也使Scala成为一种可行的低级语言。因此,内存安全成为一个重要的关注点,问题是Scala可以从Rust中学到什么(如果有的话)。此外,Rust的类型系统可以对协议、状态机和会话类型的形式进行编码,这通常对Scala也很有用。一个关键的挑战是Rust的类型规则本质上是流敏感的,但Scala的类型系统不是。在本文中,我们概述了一种实现静态保证的可能方法,类似于Rust,只需要对Scala的类型系统进行轻微的扩展。我们的解决方案基于两个组件:首先,观察到延续传递样式(CPS)或一元样式可以将流敏感检查问题转换为基于作用域的类型检查问题。其次,在前面介绍的具有二级值的类型系统扩展上,我们使用二级值对基于作用域的生命周期进行建模。
{"title":"Rust-like borrowing with 2nd-class values (short paper)","authors":"Leo Osvald, Tiark Rompf","doi":"10.1145/3136000.3136010","DOIUrl":"https://doi.org/10.1145/3136000.3136010","url":null,"abstract":"The Rust programming language demonstrates that memory safety can be achieved in a practical systems language, based on a sophisticated type system that controls object lifetimes and aliasing through notions of ownership and borrowing. While Scala has traditionally targeted only managed language runtimes, the ScalaNative effort makes Scala a viable low-level language as well. Thus, memory safety becomes an important concern, and the question bears asking what, if anything, Scala can learn from Rust. In addition, Rust's type system can encode forms of protocols, state machines, and session types, which would also be useful for Scala in general. A key challenge is that Rust's typing rules are inherently flow-sensitive, but Scala's type system is not. In this paper, we sketch one possible method of achieving static guarantees similar to Rust with only mild extensions to Scala's type system. Our solution is based on two components: First, the observation that continuation passing style (CPS) or monadic style can transform a flow-sensitive checking problem into a type-checking problem based on scopes. Second, on a previously presented type system extension with second-class values, which we use to model scope-based lifetimes.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131080767","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
Towards algorithmic typing for DOT (short paper) DOT(短文)的算法输入
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136003
A. Nieto
The Dependent Object Types (DOT) calculus formalizes key features of Scala. The D<: calculus is the core of DOT. To date, presentations of D<: have used declarative, as opposed to algorithmic, typing and subtyping rules. Unfortunately, algorithmic typing for full D<: is known to be an undecidable problem. We explore the design space for a restricted version of D<: that has decidable typechecking. Even in this simplified D<:, algorithmic typing and subtyping are tricky, due to the "bad bounds" problem. The Scala compiler bypasses bad bounds at the cost of a loss in expressiveness in its type system. Based on the approach taken in the Scala compiler, we present the Step Typing and Step Subtyping relations for D<:. These relations are sound and decidable. They are not complete with respect to the original D<: typing rules.
依赖对象类型(DOT)演算形式化了Scala的关键特性。D<:微积分是DOT的核心。迄今为止,D<:的表示使用了声明性规则,而不是算法、类型和子类型规则。不幸的是,对于全D<:的算法类型是一个无法确定的问题。我们探索具有可确定类型检查的受限版本D<:的设计空间。即使在这个简化的D<:中,由于“坏边界”问题,算法类型和子类型也很棘手。Scala编译器绕过坏边界的代价是其类型系统的表达性损失。基于Scala编译器中采用的方法,我们给出了D<:的步类型和步子类型关系。这些关系是健全和可决定的。相对于原始的D<:键入规则,它们是不完整的。
{"title":"Towards algorithmic typing for DOT (short paper)","authors":"A. Nieto","doi":"10.1145/3136000.3136003","DOIUrl":"https://doi.org/10.1145/3136000.3136003","url":null,"abstract":"The Dependent Object Types (DOT) calculus formalizes key features of Scala. The D<: calculus is the core of DOT. To date, presentations of D<: have used declarative, as opposed to algorithmic, typing and subtyping rules. Unfortunately, algorithmic typing for full D<: is known to be an undecidable problem. We explore the design space for a restricted version of D<: that has decidable typechecking. Even in this simplified D<:, algorithmic typing and subtyping are tricky, due to the \"bad bounds\" problem. The Scala compiler bypasses bad bounds at the cost of a loss in expressiveness in its type system. Based on the approach taken in the Scala compiler, we present the Step Typing and Step Subtyping relations for D<:. These relations are sound and decidable. They are not complete with respect to the original D<: typing rules.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"8 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125258569","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}
引用次数: 8
Effekt: extensible algebraic effects in Scala (short paper) 效果:Scala中的可扩展代数效果(短文)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136007
J. Brachthäuser, Philipp Schuster
Algebraic effects are an interesting way to structure effectful programs and offer new modularity properties. We present the Scala library Effekt, which is implemented in terms of a monad for multi-prompt delimited continuations and centered around capability passing. This makes the newly proposed feature of implicit function types a perfect fit for the syntax of our library. Basing the library design on capability passing and a polymorphic embedding of effect handlers furthermore opens up interesting dimensions of extensibility. Preliminary benchmarks comparing Effekt with an established library suggest significant speedups.
代数效应是构造有效程序和提供新的模块化特性的一种有趣的方法。我们介绍了Scala库Effekt,它是根据一个单子实现的,用于多提示分隔的延续,并以能力传递为中心。这使得新提出的隐式函数类型特性非常适合我们库的语法。基于能力传递和多态嵌入效果处理程序的库设计进一步开辟了有趣的可扩展性维度。初步的基准测试将effect与一个已建立的库进行了比较,结果表明它具有显著的速度提升。
{"title":"Effekt: extensible algebraic effects in Scala (short paper)","authors":"J. Brachthäuser, Philipp Schuster","doi":"10.1145/3136000.3136007","DOIUrl":"https://doi.org/10.1145/3136000.3136007","url":null,"abstract":"Algebraic effects are an interesting way to structure effectful programs and offer new modularity properties. We present the Scala library Effekt, which is implemented in terms of a monad for multi-prompt delimited continuations and centered around capability passing. This makes the newly proposed feature of implicit function types a perfect fit for the syntax of our library. Basing the library design on capability passing and a polymorphic embedding of effect handlers furthermore opens up interesting dimensions of extensibility. Preliminary benchmarks comparing Effekt with an established library suggest significant speedups.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"80 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115305281","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}
引用次数: 27
A Scala framework for supercompilation 用于超编译的Scala框架
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136011
Nathaniel Nystrom
Supercompilation is a program transformation technique that attempts to evaluate programs as much as possible at compile time. Supercompilation has been used for theorem proving, function inversion, and most notably optimization, especially of functional programs. However, the technique has numerous practical problems that prevent it from being applied in mainstream compilers. In this paper, we describe a framework that can be used for experimenting with supercompilation techniques. Our framework allows supercompilers to be constructed directly from an interpreter. The user specifies the interpreter using rewrite rules and the framework handles termination checking, generalization, and residualization. We demonstrate the approach by implementing a supercompiler for JavaScript.
超编译是一种程序转换技术,它试图在编译时尽可能多地评估程序。超编译已经被用于定理证明、函数反转,以及最显著的优化,尤其是函数式程序。然而,该技术有许多实际问题,阻碍了它在主流编译器中的应用。在本文中,我们描述了一个可用于实验超编译技术的框架。我们的框架允许直接从解释器构造超编译器。用户使用重写规则指定解释器,框架处理终止检查、泛化和剩余化。我们通过为JavaScript实现一个超级编译器来演示这种方法。
{"title":"A Scala framework for supercompilation","authors":"Nathaniel Nystrom","doi":"10.1145/3136000.3136011","DOIUrl":"https://doi.org/10.1145/3136000.3136011","url":null,"abstract":"Supercompilation is a program transformation technique that attempts to evaluate programs as much as possible at compile time. Supercompilation has been used for theorem proving, function inversion, and most notably optimization, especially of functional programs. However, the technique has numerous practical problems that prevent it from being applied in mainstream compilers. In this paper, we describe a framework that can be used for experimenting with supercompilation techniques. Our framework allows supercompilers to be constructed directly from an interpreter. The user specifies the interpreter using rewrite rules and the framework handles termination checking, generalization, and residualization. We demonstrate the approach by implementing a supercompiler for JavaScript.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"464 2","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131580474","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}
引用次数: 4
Squid: type-safe, hygienic, and reusable quasiquotes Squid:类型安全、卫生和可重用的准引用
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136005
L. Parreaux, A. Shaikhha, Christoph E. Koch
Quasiquotes have been shown to greatly simplify the task of metaprogramming. This is in part because they hide the data structures of the intermediate representation (IR), instead allowing metaprogrammers to use the concrete syntax of the language they manipulate. Scala has had "syntactic" quasiquotes for a long time, but still misses a statically-typed version like in MetaOCaml, Haskell and F#. This safer flavor of quasiquotes has been particularly useful for staging and domain-specific languages. In this paper we present Squid, a metaprogramming system for Scala that fills this gap. Squid quasiquotes are novel in three ways: they are the first statically-typed quasiquotes we know that allow code inspection (via pattern matching); they are implemented purely as a macro library, without modifications to the compiler; and they are reusable in the sense that they can manipulate different IRs. Adapting (or binding) a new IR to Squid is done simply by implementing a well-defined interface in the style of object algebras (i.e., tagless-final). We detail how Squid is implemented, leveraging the metaprogramming tools already offered by Scala, and show three application examples: the definition of a binding for a DSL in the style of LMS; a safe ANF conversion; and the introduction of type-safe, hygienic macros as an alternative to the current macro system.
准引号已经被证明可以极大地简化元编程的任务。这在一定程度上是因为它们隐藏了中间表示(IR)的数据结构,而不是允许元程序员使用他们操作的语言的具体语法。Scala已经有“语法”准引号很长时间了,但是仍然缺少静态类型的版本,比如MetaOCaml、Haskell和f#。这种更安全的准引号风格对于阶段语言和特定于领域的语言特别有用。在本文中,我们介绍了Squid,一个用于Scala的元编程系统,它填补了这一空白。Squid准引号在三个方面是新颖的:它们是我们所知道的第一个允许代码检查(通过模式匹配)的静态类型准引号;它们完全作为宏库实现,不需要修改编译器;它们是可重复使用的,因为它们可以操纵不同的ir。将一个新的IR适配(或绑定)到Squid,只需以对象代数(即tagless-final)的风格实现一个定义良好的接口即可完成。我们详细介绍了Squid是如何实现的,利用Scala已经提供的元编程工具,并展示了三个应用示例:以LMS风格为DSL定义绑定;安全的ANF转换;以及引入类型安全、卫生的宏作为当前宏系统的替代方案。
{"title":"Squid: type-safe, hygienic, and reusable quasiquotes","authors":"L. Parreaux, A. Shaikhha, Christoph E. Koch","doi":"10.1145/3136000.3136005","DOIUrl":"https://doi.org/10.1145/3136000.3136005","url":null,"abstract":"Quasiquotes have been shown to greatly simplify the task of metaprogramming. This is in part because they hide the data structures of the intermediate representation (IR), instead allowing metaprogrammers to use the concrete syntax of the language they manipulate. Scala has had \"syntactic\" quasiquotes for a long time, but still misses a statically-typed version like in MetaOCaml, Haskell and F#. This safer flavor of quasiquotes has been particularly useful for staging and domain-specific languages. In this paper we present Squid, a metaprogramming system for Scala that fills this gap. Squid quasiquotes are novel in three ways: they are the first statically-typed quasiquotes we know that allow code inspection (via pattern matching); they are implemented purely as a macro library, without modifications to the compiler; and they are reusable in the sense that they can manipulate different IRs. Adapting (or binding) a new IR to Squid is done simply by implementing a well-defined interface in the style of object algebras (i.e., tagless-final). We detail how Squid is implemented, leveraging the metaprogramming tools already offered by Scala, and show three application examples: the definition of a binding for a DSL in the style of LMS; a safe ANF conversion; and the introduction of type-safe, hygienic macros as an alternative to the current macro system.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"62 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116593349","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}
引用次数: 10
Making collection operations optimal with aggressive JIT compilation 通过积极的JIT编译使收集操作最优
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136002
Aleksandar Prokopec, David Leopoldseder, Gilles Duboscq, Thomas Würthinger
Functional collection combinators are a neat and widely accepted data processing abstraction. However, their generic nature results in high abstraction overheads -- Scala collections are known to be notoriously slow for typical tasks. We show that proper optimizations in a JIT compiler can widely eliminate overheads imposed by these abstractions. Using the open-source Graal JIT compiler, we achieve speedups of up to 20x on collection workloads compared to the standard HotSpot C2 compiler. Consequently, a sufficiently aggressive JIT compiler allows the language compiler, such as Scalac, to focus on other concerns. In this paper, we show how optimizations, such as inlining, polymorphic inlining, and partial escape analysis, are combined in Graal to produce collections code that is optimal with respect to manually written code, or close to optimal. We argue why some of these optimizations are more effectively done by a JIT compiler. We then identify specific use-cases that most current JIT compilers do not optimize well, warranting special treatment from the language compiler.
函数集合组合器是一种简洁且被广泛接受的数据处理抽象。然而,它们的泛型特性导致了很高的抽象开销——众所周知,Scala集合对于典型任务来说速度很慢。我们展示了JIT编译器中的适当优化可以广泛地消除这些抽象所带来的开销。使用开源的Graal JIT编译器,与标准的HotSpot C2编译器相比,我们在收集工作负载上实现了高达20倍的速度提升。因此,一个足够积极的JIT编译器允许语言编译器(如Scalac)专注于其他关注点。在本文中,我们展示了如何在Graal中组合优化,例如内联、多态内联和部分逸出分析,以生成相对于手动编写的代码而言是最优的或接近最优的集合代码。我们将讨论为什么JIT编译器可以更有效地完成其中一些优化。然后,我们确定当前大多数JIT编译器不能很好地优化的特定用例,要求语言编译器对其进行特殊处理。
{"title":"Making collection operations optimal with aggressive JIT compilation","authors":"Aleksandar Prokopec, David Leopoldseder, Gilles Duboscq, Thomas Würthinger","doi":"10.1145/3136000.3136002","DOIUrl":"https://doi.org/10.1145/3136000.3136002","url":null,"abstract":"Functional collection combinators are a neat and widely accepted data processing abstraction. However, their generic nature results in high abstraction overheads -- Scala collections are known to be notoriously slow for typical tasks. We show that proper optimizations in a JIT compiler can widely eliminate overheads imposed by these abstractions. Using the open-source Graal JIT compiler, we achieve speedups of up to 20x on collection workloads compared to the standard HotSpot C2 compiler. Consequently, a sufficiently aggressive JIT compiler allows the language compiler, such as Scalac, to focus on other concerns. In this paper, we show how optimizations, such as inlining, polymorphic inlining, and partial escape analysis, are combined in Graal to produce collections code that is optimal with respect to manually written code, or close to optimal. We argue why some of these optimizations are more effectively done by a JIT compiler. We then identify specific use-cases that most current JIT compilers do not optimize well, warranting special treatment from the language compiler.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"63 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123410296","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}
引用次数: 23
The limitations of type classes as subtyped implicits (short paper) 类型类作为子类型隐式的局限性(短文)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136006
Adelbert Chang
Type classes enable a powerful form of ad-hoc polymorphism which provide solutions to many programming design problems. Inspired by this, Scala programmers have striven to emulate them in the design of libraries like Scalaz and Cats. The natural encoding of type classes combines subtyping and implicits, both central features of Scala. However, this encoding has limitations. If the type class hierarchy branches, seemingly valid programs can hit implicit resolution failures. These failures must then be solved by explicitly passing the implicit arguments which is cumbersome and negates the advantages of type classes. In this paper we describe instances of this problem and show that they are not merely theoretical but often arise in practice. We also discuss and compare the space of solutions to this problem in Scala today and in the future.
类型类支持一种强大的特别多态性形式,它为许多编程设计问题提供了解决方案。受此启发,Scala程序员努力在Scala和Cats等库的设计中模仿它们。类型类的自然编码结合了子类型和隐式,这两个都是Scala的核心特性。然而,这种编码有局限性。这些失败必须通过显式传递隐式参数来解决,这很麻烦,并且否定了类型类的优点。在本文中,我们描述了这一问题的实例,并表明它们不仅仅是理论上的,而且在实践中经常出现。我们还讨论并比较了Scala现在和将来解决这个问题的空间。
{"title":"The limitations of type classes as subtyped implicits (short paper)","authors":"Adelbert Chang","doi":"10.1145/3136000.3136006","DOIUrl":"https://doi.org/10.1145/3136000.3136006","url":null,"abstract":"Type classes enable a powerful form of ad-hoc polymorphism which provide solutions to many programming design problems. Inspired by this, Scala programmers have striven to emulate them in the design of libraries like Scalaz and Cats. The natural encoding of type classes combines subtyping and implicits, both central features of Scala. However, this encoding has limitations. If the type class hierarchy branches, seemingly valid programs can hit implicit resolution failures. These failures must then be solved by explicitly passing the implicit arguments which is cumbersome and negates the advantages of type classes. In this paper we describe instances of this problem and show that they are not merely theoretical but often arise in practice. We also discuss and compare the space of solutions to this problem in Scala today and in the future.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"35 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124009011","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
ScalaSMT: satisfiability modulo theory in Scala (tool paper) Scala中的可满足模理论(工具论文)
Pub Date : 2017-10-22 DOI: 10.1145/3136000.3136004
F. Cassez, A. Sloane
Satisfiability modulo theory (SMT) consists of determining the satisfiability of logical formulas. It can reason in various formal theories, e.g., in linear integer or real arithmetic, first-order logic, or logics of arrays. An SMT solver is a program that implements the corresponding algorithms to automatically determine whether a logical formula is satisfiable. The SMTLIB initiative provides a common input and output format based on S-expressions for interacting with SMT solvers. We present ScalaSMT, a Scala library that provides an abstraction over the SMTLIB format. The library brings consistency and type safety to the textual and dynamically typed world of SMTLIB solver interaction. ScalaSMT relies on the SMTLIB input/output capabilities of the solvers and consequently provides access to numerous popular SMTLIB-compliant solvers such as Z3, CVC4, Yices, MathSat5 or SMTinterpol. ScalaSMT is easily extendable (SMTLIB commands and theories can be added) and configurable (SMTLIB-compliant solvers can be added). ScalaSMT fills a gap in the Scala library landscape by providing support for powerful logical reasoning algorithms.
可满足模理论(SMT)包括确定逻辑公式的可满足性。它可以在各种形式理论中进行推理,例如线性整数或实算术,一阶逻辑或数组逻辑。SMT求解器是实现相应算法来自动确定逻辑公式是否可满足的程序。SMTLIB计划提供了一种基于s表达式的通用输入和输出格式,用于与SMT求解器交互。我们介绍ScalaSMT,这是一个Scala库,它提供了SMTLIB格式的抽象。该库为文本和动态类型的SMTLIB求解器交互世界带来了一致性和类型安全性。ScalaSMT依赖于求解器的SMTLIB输入/输出功能,因此可以访问许多流行的符合SMTLIB的求解器,如Z3、CVC4、Yices、MathSat5或SMTinterpol。ScalaSMT易于扩展(可以添加SMTLIB命令和理论)和配置(可以添加SMTLIB兼容的求解器)。ScalaSMT通过提供对强大逻辑推理算法的支持,填补了Scala库领域的空白。
{"title":"ScalaSMT: satisfiability modulo theory in Scala (tool paper)","authors":"F. Cassez, A. Sloane","doi":"10.1145/3136000.3136004","DOIUrl":"https://doi.org/10.1145/3136000.3136004","url":null,"abstract":"Satisfiability modulo theory (SMT) consists of determining the satisfiability of logical formulas. It can reason in various formal theories, e.g., in linear integer or real arithmetic, first-order logic, or logics of arrays. An SMT solver is a program that implements the corresponding algorithms to automatically determine whether a logical formula is satisfiable. The SMTLIB initiative provides a common input and output format based on S-expressions for interacting with SMT solvers. We present ScalaSMT, a Scala library that provides an abstraction over the SMTLIB format. The library brings consistency and type safety to the textual and dynamically typed world of SMTLIB solver interaction. ScalaSMT relies on the SMTLIB input/output capabilities of the solvers and consequently provides access to numerous popular SMTLIB-compliant solvers such as Z3, CVC4, Yices, MathSat5 or SMTinterpol. ScalaSMT is easily extendable (SMTLIB commands and theories can be added) and configurable (SMTLIB-compliant solvers can be added). ScalaSMT fills a gap in the Scala library landscape by providing support for powerful logical reasoning algorithms.","PeriodicalId":158126,"journal":{"name":"Proceedings of the 8th ACM SIGPLAN International Symposium on Scala","volume":"58 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2017-10-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123444393","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}
引用次数: 7
期刊
Proceedings of the 8th 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