首页 > 最新文献

Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala最新文献

英文 中文
Semantics-driven interoperability between Scala.js and JavaScript Scala.js和JavaScript之间语义驱动的互操作性
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998404
S. Doeraene, Tobias Schlatter, Nicolas Stucki
Hundreds of programming languages compile to JavaScript. Yet, most of them fail, at one level or another, to provide satisfactory interoperability with JavaScript APIs. This is limiting, as interoperability is at least required to manipulate web pages through the DOM API, but also to use the eco-system of existing JavaScript libraries. This paper presents the interoperability features of Scala.js, which solves the shortcomings of previous approaches. Scala.js offers a separate hierarchy of JavaScript types, whose operations have semantics borrowed from ECMAScript 2015. The interoperability features are complete with respect to ECMAScript 2015, save for two exceptions which are still being worked on. This allows Scala.js programs to perform any operation that an ECMAScript program could do, thereby guaranteeing that they can talk to any JavaScript library.
数百种编程语言都可以编译成JavaScript。然而,它们中的大多数在某种程度上无法提供与JavaScript api的令人满意的互操作性。这是有限制的,因为互操作性至少需要通过DOM API操作web页面,而且还需要使用现有JavaScript库的生态系统。本文介绍了Scala.js的互操作性特性,解决了以往方法的不足。Scala.js提供了一个独立的JavaScript类型层次结构,其操作的语义借鉴了ECMAScript 2015。关于ECMAScript 2015的互操作性特性是完整的,除了两个仍在处理的例外。这允许Scala.js程序执行ECMAScript程序可以执行的任何操作,从而保证它们可以与任何JavaScript库通信。
{"title":"Semantics-driven interoperability between Scala.js and JavaScript","authors":"S. Doeraene, Tobias Schlatter, Nicolas Stucki","doi":"10.1145/2998392.2998404","DOIUrl":"https://doi.org/10.1145/2998392.2998404","url":null,"abstract":"Hundreds of programming languages compile to JavaScript. Yet, most of them fail, at one level or another, to provide satisfactory interoperability with JavaScript APIs. This is limiting, as interoperability is at least required to manipulate web pages through the DOM API, but also to use the eco-system of existing JavaScript libraries. This paper presents the interoperability features of Scala.js, which solves the shortcomings of previous approaches. Scala.js offers a separate hierarchy of JavaScript types, whose operations have semantics borrowed from ECMAScript 2015. The interoperability features are complete with respect to ECMAScript 2015, save for two exceptions which are still being worked on. This allows Scala.js programs to perform any operation that an ECMAScript program could do, thereby guaranteeing that they can talk to any JavaScript library.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"14 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115122217","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
A scalable infrastructure for teaching concepts of programming languages in Scala with WebLab: an experience report 使用WebLab在Scala中教授编程语言概念的可扩展基础设施:经验报告
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998402
T. V. D. Lippe, Thomas Smith, Daniël A. A. Pelsmaeker, E. Visser
In this paper, we report on our experience in teaching a course on concepts of programming languages at TU Delft based on Krishnamurthi's PAPL book with the definitional interpreter approach using Scala as meta-language and using the WebLab learning management system. In particular, we discuss our experience with encoding of definitional interpreters in Scala using case classes, pattern matching, and recursive functions; offering this material in the web-based learning management system WebLab; automated grading and feedback of interpreter submissions using unit tests; testing tests to force students to formulate tests, instead of just implementing interpreters; generation of tests based on a reference implementation to reduce the effort of producing unit tests; and the construction of a product line of interpreters in order to maximize reuse and consistency between reference implementations.
在本文中,我们报告了我们在代尔夫特理工大学教授编程语言概念课程的经验,该课程基于Krishnamurthi的PAPL书籍,使用定义解释器方法,使用Scala作为元语言并使用WebLab学习管理系统。特别地,我们讨论了我们在Scala中使用case类、模式匹配和递归函数编码定义解释器的经验;在网络学习管理系统WebLab中提供这些材料;使用单元测试对解释器提交进行自动评分和反馈;测试测试,迫使学生制定测试,而不是仅仅实现口译;基于参考实现生成测试,以减少生成单元测试的工作量;并构建解释器产品线,以最大限度地提高参考实现之间的重用和一致性。
{"title":"A scalable infrastructure for teaching concepts of programming languages in Scala with WebLab: an experience report","authors":"T. V. D. Lippe, Thomas Smith, Daniël A. A. Pelsmaeker, E. Visser","doi":"10.1145/2998392.2998402","DOIUrl":"https://doi.org/10.1145/2998392.2998402","url":null,"abstract":"In this paper, we report on our experience in teaching a course on concepts of programming languages at TU Delft based on Krishnamurthi's PAPL book with the definitional interpreter approach using Scala as meta-language and using the WebLab learning management system. In particular, we discuss our experience with encoding of definitional interpreters in Scala using case classes, pattern matching, and recursive functions; offering this material in the web-based learning management system WebLab; automated grading and feedback of interpreter submissions using unit tests; testing tests to force students to formulate tests, instead of just implementing interpreters; generation of tests based on a reference implementation to reduce the effort of producing unit tests; and the construction of a product line of interpreters in order to maximize reuse and consistency between reference implementations.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130463009","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}
引用次数: 6
The sbt-rats parser generator plugin for Scala (tool paper) Scala的sbt-rats解析器生成器插件(工具论文)
Pub Date : 2016-10-30 DOI: 10.1145/2998392.3001580
A. Sloane, F. Cassez, Scott Buckley
Tools for creating parsers are a key part of a mature language eco-system. Scala has traditionally relied on combinator libraries for defining parsers but being libraries they come with fundamental implementation limitations. An alternative is to use a Java-based parser generator such as ANTLR or Rats! but these tools are quite verbose and not ideal to use with Scala code. We describe our experiences with Scala-focused parser generation that is embodied in our sbtrats plugin for the Scala Build Tool. At its simplest, sbtrats provides a bridge to the Rats! parser generator for Java. On top of this bridge, we have a simple grammar definition notation that incorporates annotations for tree construction and pretty-printing. As well as generating a Rats! grammar, sbtrats can optionally generate case class definitions for the tree structure and a pretty-printer defined using our Kiama language processing library. We explain the sbtrats grammar notation and describe our positive experiences using it to define grammars for LLVM assembly notation and the SMTLIB input/output language for SMT solvers.
创建解析器的工具是成熟语言生态系统的关键部分。Scala传统上依赖于组合子库来定义解析器,但作为库,它们具有基本的实现限制。另一种选择是使用基于java的解析器生成器,如ANTLR或Rats!但是这些工具非常冗长,不适合用于Scala代码。我们描述了我们在Scala构建工具的sbtrats插件中使用以Scala为中心的解析器生成的经验。简单地说,sbtrats提供了与Rats的桥梁!用于Java的解析器生成器。在这个桥的顶部,我们有一个简单的语法定义符号,它包含了用于树构造和漂亮打印的注释。以及生成一个老鼠!语法,sbtrats可以选择性地为树结构和使用Kiama语言处理库定义的漂亮打印机生成大小写类定义。我们解释了sbtrats语法表示法,并描述了我们使用它定义LLVM汇编表示法的语法和SMTLIB输入/输出语言的SMT求解器的积极经验。
{"title":"The sbt-rats parser generator plugin for Scala (tool paper)","authors":"A. Sloane, F. Cassez, Scott Buckley","doi":"10.1145/2998392.3001580","DOIUrl":"https://doi.org/10.1145/2998392.3001580","url":null,"abstract":"Tools for creating parsers are a key part of a mature language eco-system. Scala has traditionally relied on combinator libraries for defining parsers but being libraries they come with fundamental implementation limitations. An alternative is to use a Java-based parser generator such as ANTLR or Rats! but these tools are quite verbose and not ideal to use with Scala code. We describe our experiences with Scala-focused parser generation that is embodied in our sbtrats plugin for the Scala Build Tool. At its simplest, sbtrats provides a bridge to the Rats! parser generator for Java. On top of this bridge, we have a simple grammar definition notation that incorporates annotations for tree construction and pretty-printing. As well as generating a Rats! grammar, sbtrats can optionally generate case class definitions for the tree structure and a pretty-printer defined using our Kiama language processing library. We explain the sbtrats grammar notation and describe our positive experiences using it to define grammars for LLVM assembly notation and the SMTLIB input/output language for SMT solvers.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"2012 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127384102","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
SecureScala: Scala embedding of secure computations SecureScala:安全计算的Scala嵌入
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998403
M. Hauck, Savvas Savvides, P. Eugster, M. Mezini, G. Salvaneschi
Cloud computing offers an attractive and cost-efficient computing platform and hence it has been widely adopted by the industry and the government. At the same time, cloud computing poses a serious security challenge because sensitive data must often be outsourced to third party entities that can access the data and perform computations on them. Partial homomorphic encryption is promising for secure computation, since it allows programs to be executed over encrypted data. Despite advances in cryptographic techniques have improved the expressivity of such programs, integration with mainstream languages has seen little progress. To this end, we present SecureScala, a domain-specific language in Scala that allows expressing secure programs without requiring any cryptographic knowledge. SecureScala is based on a novel combination of free monads and free applicative functors and supports parallel execution and static analyzability. We evaluate our approach through several case studies, demonstrate its expressivity, and show that it incurs in limited performance overhead.
云计算提供了一个具有吸引力和成本效益的计算平台,因此它已被业界和政府广泛采用。与此同时,云计算带来了严重的安全挑战,因为敏感数据通常必须外包给能够访问数据并对其进行计算的第三方实体。部分同态加密有望实现安全计算,因为它允许在加密数据上执行程序。尽管密码学技术的进步提高了这些程序的表达能力,但与主流语言的集成几乎没有进展。为此,我们提出了SecureScala,这是Scala中的一种特定于领域的语言,它允许在不需要任何加密知识的情况下表达安全程序。SecureScala基于自由单子和自由应用函子的新颖组合,支持并行执行和静态可分析性。我们通过几个案例研究评估了我们的方法,展示了它的表现力,并表明它只带来有限的性能开销。
{"title":"SecureScala: Scala embedding of secure computations","authors":"M. Hauck, Savvas Savvides, P. Eugster, M. Mezini, G. Salvaneschi","doi":"10.1145/2998392.2998403","DOIUrl":"https://doi.org/10.1145/2998392.2998403","url":null,"abstract":"Cloud computing offers an attractive and cost-efficient computing platform and hence it has been widely adopted by the industry and the government. At the same time, cloud computing poses a serious security challenge because sensitive data must often be outsourced to third party entities that can access the data and perform computations on them. Partial homomorphic encryption is promising for secure computation, since it allows programs to be executed over encrypted data. Despite advances in cryptographic techniques have improved the expressivity of such programs, integration with mainstream languages has seen little progress. To this end, we present SecureScala, a domain-specific language in Scala that allows expressing secure programs without requiring any cryptographic knowledge. SecureScala is based on a novel combination of free monads and free applicative functors and supports parallel execution and static analyzability. We evaluate our approach through several case studies, demonstrate its expressivity, and show that it incurs in limited performance overhead.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"216 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131589077","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
RandIR: differential testing for embedded compilers 嵌入式编译器的差异测试
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998397
Georg Ofenbeck, Tiark Rompf, Markus Püschel
This paper describes RandIR, a tool for differential testing of compilers using random instances of a given intermediate representation (IR). RandIR assumes no fixed target language but instead supports extensible IR-definitions through an internal IR-independent representation of operations. This makes it particularly well suited to test embedded compilers for multi-stage programming, which is our main use case. The ideas underlying our work, however, are more generally applicable. RandIR is able to automatically simplify failing instances of a test, a technique commonly referred to as shrinking. This enables testing with large random IR samples, thus increasing the odds of detecting a buggy behavior, while still being able to simplify failing instances to human-readable code.
本文描述了RandIR,一个使用给定中间表示(IR)的随机实例对编译器进行差分测试的工具。RandIR没有假设固定的目标语言,而是通过独立于ir的内部操作表示来支持可扩展的ir定义。这使得它特别适合测试用于多阶段编程的嵌入式编译器,这是我们的主要用例。然而,我们工作的基础思想更普遍适用。RandIR能够自动简化测试的失败实例,这是一种通常被称为收缩的技术。这样可以使用大量随机IR样本进行测试,从而增加检测错误行为的几率,同时仍然能够将失败实例简化为人类可读的代码。
{"title":"RandIR: differential testing for embedded compilers","authors":"Georg Ofenbeck, Tiark Rompf, Markus Püschel","doi":"10.1145/2998392.2998397","DOIUrl":"https://doi.org/10.1145/2998392.2998397","url":null,"abstract":"This paper describes RandIR, a tool for differential testing of compilers using random instances of a given intermediate representation (IR). RandIR assumes no fixed target language but instead supports extensible IR-definitions through an internal IR-independent representation of operations. This makes it particularly well suited to test embedded compilers for multi-stage programming, which is our main use case. The ideas underlying our work, however, are more generally applicable. RandIR is able to automatically simplify failing instances of a test, a technique commonly referred to as shrinking. This enables testing with large random IR samples, thus increasing the odds of detecting a buggy behavior, while still being able to simplify failing instances to human-readable code.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"61 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127992767","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}
引用次数: 17
A generic algorithm for checking exhaustivity of pattern matching (short paper) 一种检查模式匹配穷竭性的通用算法(短文)
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998401
Fengyun Liu
Algebraic data types and pattern matching are key features of func- tional programming languages. Exhaustivity checking of pattern matching is a safety belt that defends against unmatched excep- tions at runtime and boosts type safety. However, the presence of language features like inheritance, typecase, traits, GADTs, path- dependent types and union types makes the checking difficult and the algorithm complex. In this paper we propose a generic algorithm that decouples the checking algorithm from specific type theories. The decoupling makes the algorithm simple and enables easy customization for specific type systems.
代数数据类型和模式匹配是函数式编程语言的关键特征。模式匹配的穷竭性检查是一条安全带,可以防止运行时出现不匹配的异常,并提高类型安全性。然而,诸如继承、类型类型、特征、gadt、路径依赖类型和联合类型等语言特性的存在使得检查变得困难,算法变得复杂。本文提出了一种将检查算法与特定类型理论解耦的通用算法。解耦使得算法简单,并且可以方便地为特定类型系统定制。
{"title":"A generic algorithm for checking exhaustivity of pattern matching (short paper)","authors":"Fengyun Liu","doi":"10.1145/2998392.2998401","DOIUrl":"https://doi.org/10.1145/2998392.2998401","url":null,"abstract":"Algebraic data types and pattern matching are key features of func- tional programming languages. Exhaustivity checking of pattern matching is a safety belt that defends against unmatched excep- tions at runtime and boosts type safety. However, the presence of language features like inheritance, typecase, traits, GADTs, path- dependent types and union types makes the checking difficult and the algorithm complex. In this paper we propose a generic algorithm that decouples the checking algorithm from specific type theories. The decoupling makes the algorithm simple and enables easy customization for specific type systems.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"50 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128321018","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
Implementing higher-kinded types in Dotty 在Dotty中实现高级类型
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998400
Martin Odersky, Guillaume Martres, Dmitry Petrashko
dotty is a new, experimental Scala compiler based on DOT, the calculus of Dependent Object Types. Higher-kinded types are a natural extension of first-order lambda calculus, and have been a core construct of Haskell and Scala. As long as such types are just partial applications of generic classes, they can be given a meaning in DOT relatively straightforwardly. But general lambdas on the type level require extensions of the DOT calculus to be expressible. This paper is an experience report where we describe and discuss four implementation strategies that we have tried out in the last three years. Each strategy was fully implemented in the dotty compiler. We discuss the usability and expressive power of each scheme, and give some indications about the amount of implementation difficulties encountered.
dotty是一个基于DOT(依赖对象类型演算)的实验性Scala编译器。高级类型是一阶lambda演算的自然扩展,并且一直是Haskell和Scala的核心结构。只要这些类型只是泛型类的部分应用程序,就可以相对直接地在DOT中赋予它们意义。但是,类型级别上的一般lambda需要DOT演算的扩展才能表示。本文是一份经验报告,其中我们描述和讨论了我们在过去三年中尝试的四种实施策略。每个策略都在dotty编译器中完全实现。我们讨论了每个方案的可用性和表达能力,并给出了实现中遇到的困难的一些指示。
{"title":"Implementing higher-kinded types in Dotty","authors":"Martin Odersky, Guillaume Martres, Dmitry Petrashko","doi":"10.1145/2998392.2998400","DOIUrl":"https://doi.org/10.1145/2998392.2998400","url":null,"abstract":"dotty is a new, experimental Scala compiler based on DOT, the calculus of Dependent Object Types. Higher-kinded types are a natural extension of first-order lambda calculus, and have been a core construct of Haskell and Scala. As long as such types are just partial applications of generic classes, they can be given a meaning in DOT relatively straightforwardly. But general lambdas on the type level require extensions of the DOT calculus to be expressible. This paper is an experience report where we describe and discuss four implementation strategies that we have tried out in the last three years. Each strategy was fully implemented in the dotty compiler. We discuss the usability and expressive power of each scheme, and give some indications about the amount of implementation difficulties encountered.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"17 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132616674","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
Reflections on LMS: exploring front-end alternatives 对LMS的反思:探索前端替代方案
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998399
Tiark Rompf
Metaprogramming techniques to generate code at runtime in a general-purpose meta-language have seen a surge of interest in recent years, driven by the widening performance gap between high-level languages and emerging hardware platforms. In the context of Scala, the LMS (Lightweight Modular Staging) framework has contributed to ``abstraction without regret''--high-level programming without performance penalty--in a number of challenging domains, through runtime code generation and embedded compiler pipelines based on stacks of DSLs. Based on this experience, this paper crystallizes some of the design decisions of LMS and discusses potential alternatives, which maintain the underlying spirit but differ in implementation choices: specifically, strategies for realizing more flexible front-end embeddings using type classes instead of higher-kinded types, and strategies for type-safe metaprogramming with untyped intermediate representations.
近年来,由于高级语言和新兴硬件平台之间不断扩大的性能差距,在运行时用通用元语言生成代码的元编程技术引起了人们的极大兴趣。在Scala的上下文中,LMS(轻量级模块化暂存)框架通过运行时代码生成和基于dsl堆栈的嵌入式编译器管道,在许多具有挑战性的领域中为“无愧于抽象”——没有性能损失的高级编程做出了贡献。基于这一经验,本文明确了LMS的一些设计决策,并讨论了可能的替代方案,它们保持了基本的精神,但在实现选择上有所不同:具体来说,使用类型类而不是高级类型实现更灵活的前端嵌入的策略,以及使用无类型中间表示的类型安全元编程的策略。
{"title":"Reflections on LMS: exploring front-end alternatives","authors":"Tiark Rompf","doi":"10.1145/2998392.2998399","DOIUrl":"https://doi.org/10.1145/2998392.2998399","url":null,"abstract":"Metaprogramming techniques to generate code at runtime in a general-purpose meta-language have seen a surge of interest in recent years, driven by the widening performance gap between high-level languages and emerging hardware platforms. In the context of Scala, the LMS (Lightweight Modular Staging) framework has contributed to ``abstraction without regret''--high-level programming without performance penalty--in a number of challenging domains, through runtime code generation and embedded compiler pipelines based on stacks of DSLs. Based on this experience, this paper crystallizes some of the design decisions of LMS and discusses potential alternatives, which maintain the underlying spirit but differ in implementation choices: specifically, strategies for realizing more flexible front-end embeddings using type classes instead of higher-kinded types, and strategies for type-safe metaprogramming with untyped intermediate representations.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"91 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126181216","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}
引用次数: 12
Reactive Async: expressive deterministic concurrency 响应式异步:表达性确定性并发
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998396
Philipp Haller, Simon Geries, Michael Eichberg, G. Salvaneschi
Concurrent programming is infamous for its difficulty. An important source of difficulty is non-determinism, stemming from unpredictable interleavings of concurrent activities. Futures and promises are widely-used abstractions that help designing deterministic concurrent programs, although this property cannot be guaranteed statically in mainstream programming languages. Deterministic-by-construction concurrent programming models avoid this issue, but they typically restrict expressiveness in important ways. This paper introduces a concurrent programming model, Reactive Async, which decouples concurrent computations using so-called cells, shared locations which generalize futures as well as recent deterministic abstractions such as LVars. Compared to previously proposed programming models Reactive Async provides (a) a fallback mechanism for the case where no computation ever computes the value of a given cell, and (b) explicit and optimized handling of cyclic dependencies. We present a complete implementation of the Reactive Async programming model as a library in Scala. Finally, the paper reports on a case study applying Reactive Async to static analyses of JVM bytecode based on the Opal framework.
并发编程因其难度而臭名昭著。困难的一个重要来源是不确定性,源于并发活动的不可预测的交织。未来和承诺是广泛使用的抽象,可以帮助设计确定性并发程序,尽管在主流编程语言中不能静态地保证这个属性。按结构确定的并发编程模型避免了这个问题,但它们通常在重要方面限制了表达性。本文介绍了一种并发编程模型,反应式异步,它使用所谓的单元解耦并发计算,共享位置概括了未来,以及最近的确定性抽象,如lvar。与之前提出的编程模型相比,Reactive Async提供了(a)在没有计算计算给定单元值的情况下的回退机制,以及(b)对循环依赖的显式和优化处理。我们提供了一个完整的响应式异步编程模型在Scala中的库实现。最后,本文报告了一个基于Opal框架将响应式异步应用于JVM字节码静态分析的案例研究。
{"title":"Reactive Async: expressive deterministic concurrency","authors":"Philipp Haller, Simon Geries, Michael Eichberg, G. Salvaneschi","doi":"10.1145/2998392.2998396","DOIUrl":"https://doi.org/10.1145/2998392.2998396","url":null,"abstract":"Concurrent programming is infamous for its difficulty. An important source of difficulty is non-determinism, stemming from unpredictable interleavings of concurrent activities. Futures and promises are widely-used abstractions that help designing deterministic concurrent programs, although this property cannot be guaranteed statically in mainstream programming languages. Deterministic-by-construction concurrent programming models avoid this issue, but they typically restrict expressiveness in important ways. This paper introduces a concurrent programming model, Reactive Async, which decouples concurrent computations using so-called cells, shared locations which generalize futures as well as recent deterministic abstractions such as LVars. Compared to previously proposed programming models Reactive Async provides (a) a fallback mechanism for the case where no computation ever computes the value of a given cell, and (b) explicit and optimized handling of cyclic dependencies. We present a complete implementation of the Reactive Async programming model as a library in Scala. Finally, the paper reports on a case study applying Reactive Async to static analyses of JVM bytecode based on the Opal framework.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"113 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121692943","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
SMT-based checking of predicate-qualified types for Scala 基于smt的Scala谓词限定类型检查
Pub Date : 2016-10-30 DOI: 10.1145/2998392.2998398
G. Schmid, Viktor Kunčak
We present *qualified types* for Scala, a form of refinement types adapted to the Scala language. Qualified types allow users to refine base types and classes using predicate expressions. We implemented a type checker for qualified types that is embedded in Scala's next-generation compiler Dotty and delegates constraint checking to an SMT solver. Our system supports many of Scala's functional as well as its object-oriented constructs. To propagate user-provided qualifier ascriptions we utilize both Scala's own type system and an incomplete, but effective qualifier inference algorithm. Our evaluation shows that for a series of examples exerting various of Scala's language features, the additional compile-time overhead is manageable. By combining these features we show that one can verify essential safety properties such as static bounds-checks while retaining several of Scala's advanced features.
我们为Scala提供了“限定类型”,这是一种适合Scala语言的细化类型。限定类型允许用户使用谓词表达式改进基类型和类。我们实现了一个用于限定类型的类型检查器,它嵌入到Scala的下一代编译器Dotty中,并将约束检查委托给SMT求解器。我们的系统支持Scala的许多函数式和面向对象的结构。为了传播用户提供的限定符属性,我们利用Scala自己的类型系统和一个不完整但有效的限定符推断算法。我们的评估表明,对于使用各种Scala语言特性的一系列示例,额外的编译时开销是可以管理的。通过结合这些特性,我们展示了可以在保留Scala的一些高级特性的同时验证基本的安全属性,如静态边界检查。
{"title":"SMT-based checking of predicate-qualified types for Scala","authors":"G. Schmid, Viktor Kunčak","doi":"10.1145/2998392.2998398","DOIUrl":"https://doi.org/10.1145/2998392.2998398","url":null,"abstract":"We present *qualified types* for Scala, a form of refinement types adapted to the Scala language. Qualified types allow users to refine base types and classes using predicate expressions. We implemented a type checker for qualified types that is embedded in Scala's next-generation compiler Dotty and delegates constraint checking to an SMT solver. Our system supports many of Scala's functional as well as its object-oriented constructs. To propagate user-provided qualifier ascriptions we utilize both Scala's own type system and an incomplete, but effective qualifier inference algorithm. Our evaluation shows that for a series of examples exerting various of Scala's language features, the additional compile-time overhead is manageable. By combining these features we show that one can verify essential safety properties such as static bounds-checks while retaining several of Scala's advanced features.","PeriodicalId":269542,"journal":{"name":"Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala","volume":"5 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-10-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116765008","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
期刊
Proceedings of the 2016 7th ACM SIGPLAN 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