首页 > 最新文献

Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation最新文献

英文 中文
Staging generic programming 阶段泛型编程
J. Yallop
Generic programming libraries such as Scrap Your Boilerplate eliminate the need to write repetitive code, but typically introduce significant performance overheads. This leaves programmers with the unfortunate choice of writing succinct but slow programs or writing tedious but efficient programs. We show how to systematically transform an implementation of the Scrap Your Boilerplate library in the multi-stage programming language MetaOCaml to eliminate the overhead, making it possible to combine the benefits of high-level abstract programming with the efficiency of low-level code.
像Scrap Your Boilerplate这样的泛型编程库消除了编写重复代码的需要,但通常会带来显著的性能开销。这给程序员留下了一个不幸的选择,要么编写简洁但缓慢的程序,要么编写乏味但高效的程序。我们展示了如何在多阶段编程语言MetaOCaml中系统地转换Scrap Your Boilerplate库的实现,以消除开销,使高级抽象编程的好处与低级代码的效率相结合成为可能。
{"title":"Staging generic programming","authors":"J. Yallop","doi":"10.1145/2847538.2847546","DOIUrl":"https://doi.org/10.1145/2847538.2847546","url":null,"abstract":"Generic programming libraries such as Scrap Your Boilerplate eliminate the need to write repetitive code, but typically introduce significant performance overheads. This leaves programmers with the unfortunate choice of writing succinct but slow programs or writing tedious but efficient programs. We show how to systematically transform an implementation of the Scrap Your Boilerplate library in the multi-stage programming language MetaOCaml to eliminate the overhead, making it possible to combine the benefits of high-level abstract programming with the efficiency of low-level code.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129770318","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
Removing runtime overhead for optimized object queries 消除优化对象查询的运行时开销
Jon Brandvein, Yanhong A. Liu
Powerful optimizations of object queries can lead to reduced asymptotic running times. However, such queries are often used in dynamic languages, and the required generality of the optimizations in handling a dynamic language can lead to significant runtime overhead as well as significantly increased code size. This paper studies combinations of optimizations for reducing this runtime overhead and code size. We describe two new optimizations --- counting elimination and result set elimination, their effectiveness when combined with inlining and when using specialized data structures, and additional optimizations enabled by type analysis and alias analysis. The two new optimizations are enabled by the high-level nature of queries, even though they are difficult and not supported by general compiler optimizations. We have run a variety of benchmarks, including distributed algorithms and benchmarks from prior best systems, obtaining a speedup of up to 56% and code size reduction of up to 37%.
对象查询的强大优化可以减少渐近运行时间。然而,这样的查询通常在动态语言中使用,并且在处理动态语言时所需的优化通用性可能导致显著的运行时开销以及显著增加的代码大小。本文研究了减少运行时开销和代码大小的优化组合。我们描述了两种新的优化——计数消除和结果集消除,它们在与内联结合使用和使用专用数据结构时的有效性,以及类型分析和别名分析支持的其他优化。这两种新的优化是由查询的高级特性支持的,尽管它们很困难,并且不受一般编译器优化的支持。我们已经运行了各种各样的基准测试,包括分布式算法和来自先前最佳系统的基准测试,获得了高达56%的加速和高达37%的代码大小减少。
{"title":"Removing runtime overhead for optimized object queries","authors":"Jon Brandvein, Yanhong A. Liu","doi":"10.1145/2847538.2847545","DOIUrl":"https://doi.org/10.1145/2847538.2847545","url":null,"abstract":"Powerful optimizations of object queries can lead to reduced asymptotic running times. However, such queries are often used in dynamic languages, and the required generality of the optimizations in handling a dynamic language can lead to significant runtime overhead as well as significantly increased code size. This paper studies combinations of optimizations for reducing this runtime overhead and code size. We describe two new optimizations --- counting elimination and result set elimination, their effectiveness when combined with inlining and when using specialized data structures, and additional optimizations enabled by type analysis and alias analysis. The two new optimizations are enabled by the high-level nature of queries, even though they are difficult and not supported by general compiler optimizations. We have run a variety of benchmarks, including distributed algorithms and benchmarks from prior best systems, obtaining a speedup of up to 56% and code size reduction of up to 37%.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"14 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128623480","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}
引用次数: 2
Toward introducing binding-time analysis to MetaOCaml 向MetaOCaml引入绑定时间分析
K. Asai
This paper relates 2-level lambda-calculus and staged lambda-calculus (restricted to 2 stages) to obtain monovariant binding-time analysis for lambda-calculus that produces the output in the form of staging annotations. The relationship between the two lambda-calculi provides us with a precise and easy instruction on how to implement binding-time analysis to be incorporated in the staged lambda-calculus. It forms a basis for introducing binding-time analysis to full-fledged staged languages such as MetaOCaml.
本文将2级λ演算和阶段λ演算(限于2级)联系起来,得到以阶段注释形式输出的λ演算的单变绑定时间分析。两个λ演算之间的关系为我们提供了一个精确而简单的指导,告诉我们如何将绑定时间分析纳入到阶段λ演算中。它为将绑定时分析引入成熟的阶段语言(如MetaOCaml)奠定了基础。
{"title":"Toward introducing binding-time analysis to MetaOCaml","authors":"K. Asai","doi":"10.1145/2847538.2847547","DOIUrl":"https://doi.org/10.1145/2847538.2847547","url":null,"abstract":"This paper relates 2-level lambda-calculus and staged lambda-calculus (restricted to 2 stages) to obtain monovariant binding-time analysis for lambda-calculus that produces the output in the form of staging annotations. The relationship between the two lambda-calculi provides us with a precise and easy instruction on how to implement binding-time analysis to be incorporated in the staged lambda-calculus. It forms a basis for introducing binding-time analysis to full-fledged staged languages such as MetaOCaml.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114339254","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}
引用次数: 5
Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation 2016年ACM SIGPLAN部分求值和程序操作研讨会论文集
Martin Erwig, Tiark Rompf
{"title":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","authors":"Martin Erwig, Tiark Rompf","doi":"10.1145/2847538","DOIUrl":"https://doi.org/10.1145/2847538","url":null,"abstract":"","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"58 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126136355","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}
引用次数: 2
BiGUL: a formally verified core language for putback-based bidirectional programming BiGUL:一种经过正式验证的基于回传的双向编程核心语言
Hsiang-Shang Ko, Tao Zan, Zhenjiang Hu
Putback-based bidirectional programming allows the programmer to write only one putback transformation, from which the unique corresponding forward transformation is derived for free. The logic of a putback transformation is more sophisticated than that of a forward transformation and does not always give rise to well-behaved bidirectional programs; this calls for more robust language design to support development of well-behaved putback transformations. In this paper, we design and implement a concise core language BiGUL for putback-based bidirectional programming to serve as a foundation for higher-level putback-based languages. BiGUL is completely formally verified in the dependently typed programming language Agda to guarantee that any putback transformation written in BiGUL is well-behaved.
基于putback的双向编程允许程序员只编写一个putback变换,从这个变换中可以免费得到唯一的对应的前向变换。向后转换的逻辑比向前转换的逻辑更复杂,并且并不总是产生行为良好的双向程序;这就需要更健壮的语言设计来支持行为良好的回推转换的开发。本文设计并实现了一种简洁的基于putback的双向编程核心语言BiGUL,为更高级的基于putback的编程语言奠定了基础。BiGUL在独立类型编程语言Agda中进行了完全的形式化验证,以保证用BiGUL编写的任何回推转换都是良好的。
{"title":"BiGUL: a formally verified core language for putback-based bidirectional programming","authors":"Hsiang-Shang Ko, Tao Zan, Zhenjiang Hu","doi":"10.1145/2847538.2847544","DOIUrl":"https://doi.org/10.1145/2847538.2847544","url":null,"abstract":"Putback-based bidirectional programming allows the programmer to write only one putback transformation, from which the unique corresponding forward transformation is derived for free. The logic of a putback transformation is more sophisticated than that of a forward transformation and does not always give rise to well-behaved bidirectional programs; this calls for more robust language design to support development of well-behaved putback transformations. In this paper, we design and implement a concise core language BiGUL for putback-based bidirectional programming to serve as a foundation for higher-level putback-based languages. BiGUL is completely formally verified in the dependently typed programming language Agda to guarantee that any putback transformation written in BiGUL is well-behaved.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"130 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115754614","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}
引用次数: 69
Finally, safely-extensible and efficient language-integrated query 最后,安全可扩展和高效的语言集成查询
Kenichi Suzuki, O. Kiselyov, Yukiyoshi Kameyama
Language-integrated query is an embedding of database queries into a host language to code queries at a higher level than the all-to-common concatenation of strings of SQL fragments. The eventually produced SQL is ensured to be well-formed and well-typed, and hence free from the embarrassing (security) problems. Language-integrated query takes advantage of the host language's functional and modular abstractions to compose and reuse queries and build query libraries. Furthermore, language-integrated query systems like T-LINQ generate efficient SQL, by applying a number of program transformations to the embedded query. Alas, the set of transformation rules is not designed to be extensible. We demonstrate a new technique of integrating database queries into a typed functional programming language, so to write well-typed, composable queries and execute them efficiently on any SQL back-end as well as on an in-memory noSQL store. A distinct feature of our framework is that both the query language as well as the transformation rules needed to generate efficient SQL are safely user-extensible, to account for many variations in the SQL back-ends, as well for domain-specific knowledge. The transformation rules are guaranteed to be type-preserving and hygienic by their very construction. They can be built from separately developed and reusable parts and arbitrarily composed into optimization pipelines. With this technique we have embedded into OCaml a relational query language that supports a very large subset of SQL including grouping and aggregation. Its types cover the complete set of intricate SQL behaviors.
语言集成查询是将数据库查询嵌入到宿主语言中,以便在比SQL片段字符串的普遍连接更高的级别上编写查询代码。最终生成的SQL保证是格式良好、类型良好的,因此不会出现令人尴尬的(安全)问题。语言集成查询利用宿主语言的功能和模块化抽象来组合和重用查询并构建查询库。此外,像T-LINQ这样的语言集成查询系统通过对嵌入式查询应用许多程序转换来生成高效的SQL。遗憾的是,转换规则集的设计并不是可扩展的。我们演示了一种将数据库查询集成到类型化函数式编程语言中的新技术,以便编写类型化良好的可组合查询,并在任何SQL后端以及内存中的noSQL存储上有效地执行它们。我们框架的一个显著特点是,查询语言和生成高效SQL所需的转换规则都是安全的用户可扩展的,以考虑SQL后端中的许多变化,以及特定于领域的知识。转换规则的构造保证了其类型保存性和卫生性。它们可以由单独开发和可重用的部件构建,并任意组合成优化管道。通过这种技术,我们在OCaml中嵌入了一种关系查询语言,它支持非常大的SQL子集,包括分组和聚合。它的类型涵盖了复杂的SQL行为的完整集合。
{"title":"Finally, safely-extensible and efficient language-integrated query","authors":"Kenichi Suzuki, O. Kiselyov, Yukiyoshi Kameyama","doi":"10.1145/2847538.2847542","DOIUrl":"https://doi.org/10.1145/2847538.2847542","url":null,"abstract":"Language-integrated query is an embedding of database queries into a host language to code queries at a higher level than the all-to-common concatenation of strings of SQL fragments. The eventually produced SQL is ensured to be well-formed and well-typed, and hence free from the embarrassing (security) problems. Language-integrated query takes advantage of the host language's functional and modular abstractions to compose and reuse queries and build query libraries. Furthermore, language-integrated query systems like T-LINQ generate efficient SQL, by applying a number of program transformations to the embedded query. Alas, the set of transformation rules is not designed to be extensible. We demonstrate a new technique of integrating database queries into a typed functional programming language, so to write well-typed, composable queries and execute them efficiently on any SQL back-end as well as on an in-memory noSQL store. A distinct feature of our framework is that both the query language as well as the transformation rules needed to generate efficient SQL are safely user-extensible, to account for many variations in the SQL back-ends, as well for domain-specific knowledge. The transformation rules are guaranteed to be type-preserving and hygienic by their very construction. They can be built from separately developed and reusable parts and arbitrarily composed into optimization pipelines. With this technique we have embedded into OCaml a relational query language that supports a very large subset of SQL including grouping and aggregation. Its types cover the complete set of intricate SQL behaviors.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"36 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"117261059","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}
引用次数: 22
Staging beyond terms: prospects and challenges 超越条件:前景与挑战
Jun Inoue, O. Kiselyov, Yukiyoshi Kameyama
Staging is a program generation paradigm with a clean, well-investigated semantics which statically ensures that the generated code is always well-typed and well-scoped. Staging is often used for specializing programs to the known properties or parts of data to improve efficiency, but so far it has been limited to generating terms. This short paper describes our ongoing work on extending staging, with its strong safety guarantees, to generation of non-terms, focusing on ML-style modules. The purpose is to map out the promises and challenges, then to pose a question to solicit the community's expertise in evaluating how essential our extensions are for the purpose of applying staging beyond the realm of terms. We demonstrate our extensions' use in specializing functor applications to eliminate its (currently large) overhead in OCaml. We explain the challenges that those extensions bring in and identify a promising line of attack. Unexpectedly, however, it turns out that we can avoid module generation altogether by representing modules, possibly containing abstract types, as polymorphic records. With the help of first-class modules, module specialization reduces to ordinary term specialization, which can be done with conventional staging. The extent to which this hack generalizes is unclear. Thus we have a question to the community: is there a compelling use case for module generation? With these insights and questions, we offer a starting point for a long-term program in the next stage of staging research.
分段是一种程序生成范例,具有清晰的、经过充分研究的语义,它静态地确保生成的代码始终具有良好的类型和作用域。分段通常用于将程序专门化到已知属性或数据部分以提高效率,但到目前为止,它仅限于生成术语。这篇短文描述了我们正在进行的工作,将分期扩展到非术语的生成,并提供强大的安全保证,重点是ml风格的模块。目的是绘制出承诺和挑战,然后提出一个问题,征求社区的专家意见,以评估我们的扩展对于应用超出术语范围的分期有多重要。我们演示了扩展在专门化函子应用程序中的使用,以消除它在OCaml中的(目前很大的)开销。我们解释了这些扩展带来的挑战,并确定了一个有希望的攻击线。然而,出乎意料的是,我们可以通过将模块(可能包含抽象类型)表示为多态记录来完全避免模块生成。在一级模块的帮助下,模块专门化可以简化为普通的术语专门化,这可以通过传统的分段来完成。目前尚不清楚这次黑客攻击的影响范围。因此,我们向社区提出了一个问题:是否有一个引人注目的模块生成用例?有了这些见解和问题,我们为下一阶段的分期研究提供了一个长期项目的起点。
{"title":"Staging beyond terms: prospects and challenges","authors":"Jun Inoue, O. Kiselyov, Yukiyoshi Kameyama","doi":"10.1145/2847538.2847548","DOIUrl":"https://doi.org/10.1145/2847538.2847548","url":null,"abstract":"Staging is a program generation paradigm with a clean, well-investigated semantics which statically ensures that the generated code is always well-typed and well-scoped. Staging is often used for specializing programs to the known properties or parts of data to improve efficiency, but so far it has been limited to generating terms. This short paper describes our ongoing work on extending staging, with its strong safety guarantees, to generation of non-terms, focusing on ML-style modules. The purpose is to map out the promises and challenges, then to pose a question to solicit the community's expertise in evaluating how essential our extensions are for the purpose of applying staging beyond the realm of terms. We demonstrate our extensions' use in specializing functor applications to eliminate its (currently large) overhead in OCaml. We explain the challenges that those extensions bring in and identify a promising line of attack. Unexpectedly, however, it turns out that we can avoid module generation altogether by representing modules, possibly containing abstract types, as polymorphic records. With the help of first-class modules, module specialization reduces to ordinary term specialization, which can be done with conventional staging. The extent to which this hack generalizes is unclear. Thus we have a question to the community: is there a compelling use case for module generation? With these insights and questions, we offer a starting point for a long-term program in the next stage of staging research.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"48 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122712866","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}
引用次数: 11
Operator precedence for data-dependent grammars 数据相关语法的运算符优先级
A. Afroozeh, Anastasia Izmaylova
Constructing parsers based on declarative specification of operator precedence is a very old research topic, and there are various existing approaches. However, these approaches are either tied to a particular parsing technique, or cannot deal with all corner cases found in programming languages. In this paper we present an implementation of declarative specification of operator precedence for general parsing that (1) is independent of the underlying parsing algorithm, (2) does not require any grammar transformation that increases the size of the grammar, (3) preserves the shape of parse trees of the original, natural grammar, and (4) can deal with intricate cases of operator precedence found in functional programming languages such as OCaml. Our new approach to operator precedence is formulated using data-dependent grammars, which extend context-free grammars with arbitrary computation, variable binding and constraints. We implemented our approach using Iguana, a data-dependent parsing framework, and evaluated it by parsing Java and OCaml source files. The results show that our approach is practical for parsing programming languages with complicated operator precedence rules.
基于运算符优先级的声明性规范构造解析器是一个非常古老的研究课题,目前已有多种方法。然而,这些方法要么与特定的解析技术绑定,要么无法处理编程语言中的所有极端情况。在本文中,我们提出了一种用于一般解析的操作符优先级声明性规范的实现,它(1)独立于底层解析算法,(2)不需要任何增加语法大小的语法转换,(3)保留原始自然语法的解析树的形状,(4)可以处理在函数式编程语言(如OCaml)中发现的复杂的操作符优先级情况。我们的操作符优先级的新方法是使用数据相关语法制定的,它扩展了上下文无关语法,具有任意计算,变量绑定和约束。我们使用Iguana(一个依赖于数据的解析框架)实现了我们的方法,并通过解析Java和OCaml源文件对其进行了评估。结果表明,该方法对于具有复杂运算符优先规则的编程语言的解析是实用的。
{"title":"Operator precedence for data-dependent grammars","authors":"A. Afroozeh, Anastasia Izmaylova","doi":"10.1145/2847538.2847540","DOIUrl":"https://doi.org/10.1145/2847538.2847540","url":null,"abstract":"Constructing parsers based on declarative specification of operator precedence is a very old research topic, and there are various existing approaches. However, these approaches are either tied to a particular parsing technique, or cannot deal with all corner cases found in programming languages. In this paper we present an implementation of declarative specification of operator precedence for general parsing that (1) is independent of the underlying parsing algorithm, (2) does not require any grammar transformation that increases the size of the grammar, (3) preserves the shape of parse trees of the original, natural grammar, and (4) can deal with intricate cases of operator precedence found in functional programming languages such as OCaml. Our new approach to operator precedence is formulated using data-dependent grammars, which extend context-free grammars with arbitrary computation, variable binding and constraints. We implemented our approach using Iguana, a data-dependent parsing framework, and evaluated it by parsing Java and OCaml source files. The results show that our approach is practical for parsing programming languages with complicated operator precedence rules.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"219 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114234175","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
Practical, general parser combinators 实用的、通用的解析器组合子
Anastasia Izmaylova, A. Afroozeh, T. Storm
Parser combinators are a popular approach to parsing where context-free grammars are represented as executable code. However, conventional parser combinators do not support left recursion, and can have worst-case exponential runtime. These limitations hinder the expressivity and performance predictability of parser combinators when constructing parsers for programming languages. In this paper we present general parser combinators that support all context-free grammars and construct a parse forest in cubic time and space in the worst case, while behaving nearly linearly on grammars of real programming languages. Our general parser combinators are based on earlier work on memoized Continuation-Passing Style (CPS) recognizers. First, we extend this work to achieve recognition in cubic time. Second, we extend the resulting cubic CPS recognizers to parsers that construct a binarized Shared Packed Parse Forest (SPPF). Our general parser combinators bring the best of both worlds: the flexibility and extensibility of conventional parser combinators and the expressivity and performance guarantees of general parsing algorithms. We used the approach presented in this paper as the basis for Meerkat, a general parser combinator library for Scala.
解析器组合子是一种流行的解析方法,其中上下文无关的语法表示为可执行代码。然而,传统的解析器组合子不支持左递归,并且可能具有最坏情况指数运行时间。在为编程语言构造解析器时,这些限制阻碍了解析器组合子的表达性和性能可预测性。本文给出了支持所有上下文无关语法的通用解析器组合子,并在最坏情况下在三次时间和空间中构造一个解析森林,而在实际编程语言的语法上表现得几乎是线性的。我们的通用解析器组合子是基于早期对记忆延续传递风格(CPS)识别器的研究。首先,我们将这项工作扩展到在三次时间内实现识别。其次,我们将生成的立方CPS识别器扩展到构建二进制共享打包解析森林(SPPF)的解析器。我们的通用解析器组合子兼有两方面的优点:传统解析器组合子的灵活性和可扩展性,以及通用解析算法的表现力和性能保证。我们使用本文中提出的方法作为Meerkat的基础,Meerkat是Scala的通用解析器组合器库。
{"title":"Practical, general parser combinators","authors":"Anastasia Izmaylova, A. Afroozeh, T. Storm","doi":"10.1145/2847538.2847539","DOIUrl":"https://doi.org/10.1145/2847538.2847539","url":null,"abstract":"Parser combinators are a popular approach to parsing where context-free grammars are represented as executable code. However, conventional parser combinators do not support left recursion, and can have worst-case exponential runtime. These limitations hinder the expressivity and performance predictability of parser combinators when constructing parsers for programming languages. In this paper we present general parser combinators that support all context-free grammars and construct a parse forest in cubic time and space in the worst case, while behaving nearly linearly on grammars of real programming languages. Our general parser combinators are based on earlier work on memoized Continuation-Passing Style (CPS) recognizers. First, we extend this work to achieve recognition in cubic time. Second, we extend the resulting cubic CPS recognizers to parsers that construct a binarized Shared Packed Parse Forest (SPPF). Our general parser combinators bring the best of both worlds: the flexibility and extensibility of conventional parser combinators and the expressivity and performance guarantees of general parsing algorithms. We used the approach presented in this paper as the basis for Meerkat, a general parser combinator library for Scala.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"26 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2016-01-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121102361","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}
引用次数: 14
A constraint language for static semantic analysis based on scope graphs 一种基于作用域图的静态语义分析约束语言
H. V. Antwerpen, P. Néron, A. Tolmach, E. Visser, Guido Wachsmuth
In previous work, we introduced scope graphs as a formalism for describing program binding structure and performing name resolution in an AST-independent way. In this paper, we show how to use scope graphs to build static semantic analyzers. We use constraints extracted from the AST to specify facts about binding, typing, and initialization. We treat name and type resolution as separate building blocks, but our approach can handle language constructs---such as record field access---for which binding and typing are mutually dependent. We also refine and extend our previous scope graph theory to address practical concerns including ambiguity checking and support for a wider range of scope relationships. We describe the details of constraint generation for a model language that illustrates many of the interesting static analysis issues associated with modules and records.
在之前的工作中,我们介绍了作用域图作为描述程序绑定结构和以独立于ast的方式执行名称解析的形式化方法。在本文中,我们展示了如何使用作用域图来构建静态语义分析器。我们使用从AST中提取的约束来指定有关绑定、类型和初始化的事实。我们将名称解析和类型解析视为独立的构建块,但是我们的方法可以处理语言结构——比如记录字段访问——对于这些语言结构,绑定和类型是相互依赖的。我们还改进和扩展了以前的作用域图理论,以解决实际问题,包括歧义检查和支持更广泛的作用域关系。我们描述了模型语言的约束生成的细节,它说明了许多与模块和记录相关的有趣的静态分析问题。
{"title":"A constraint language for static semantic analysis based on scope graphs","authors":"H. V. Antwerpen, P. Néron, A. Tolmach, E. Visser, Guido Wachsmuth","doi":"10.1145/2847538.2847543","DOIUrl":"https://doi.org/10.1145/2847538.2847543","url":null,"abstract":"In previous work, we introduced scope graphs as a formalism for describing program binding structure and performing name resolution in an AST-independent way. In this paper, we show how to use scope graphs to build static semantic analyzers. We use constraints extracted from the AST to specify facts about binding, typing, and initialization. We treat name and type resolution as separate building blocks, but our approach can handle language constructs---such as record field access---for which binding and typing are mutually dependent. We also refine and extend our previous scope graph theory to address practical concerns including ambiguity checking and support for a wider range of scope relationships. We describe the details of constraint generation for a model language that illustrates many of the interesting static analysis issues associated with modules and records.","PeriodicalId":211787,"journal":{"name":"Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation","volume":"22 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2015-12-31","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122213634","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}
引用次数: 56
期刊
Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation
全部 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