首页 > 最新文献

Dynamic Languages Symposium最新文献

英文 中文
Proxies: design principles for robust object-oriented intercession APIs 代理:健壮的面向对象的代理api的设计原则
Pub Date : 2010-10-18 DOI: 10.1145/1869631.1869638
T. V. Cutsem, Mark S. Miller
Proxies are a powerful approach to implement meta-objects in object-oriented languages without having to resort to metacircular interpretation. We introduce such a meta-level API based on proxies for Javascript. We simultaneously introduce a set of design principles that characterize such APIs in general, and compare similar APIs of other languages in terms of these principles. We highlight how principled proxy-based APIs improve code robustness by avoiding interference between base and meta-level code that occur in more common reflective intercession mechanisms.
代理是一种在面向对象语言中实现元对象的强大方法,而不必诉诸元循环解释。我们引入了这样一个基于Javascript代理的元级API。同时,我们介绍了一组设计原则,这些原则概括了这些api的特点,并根据这些原则比较了其他语言的类似api。我们强调原则性的基于代理的api如何通过避免在更常见的反射中介机制中发生的基级和元级代码之间的干扰来提高代码的健壮性。
{"title":"Proxies: design principles for robust object-oriented intercession APIs","authors":"T. V. Cutsem, Mark S. Miller","doi":"10.1145/1869631.1869638","DOIUrl":"https://doi.org/10.1145/1869631.1869638","url":null,"abstract":"Proxies are a powerful approach to implement meta-objects in object-oriented languages without having to resort to metacircular interpretation. We introduce such a meta-level API based on proxies for Javascript. We simultaneously introduce a set of design principles that characterize such APIs in general, and compare similar APIs of other languages in terms of these principles. We highlight how principled proxy-based APIs improve code robustness by avoiding interference between base and meta-level code that occur in more common reflective intercession mechanisms.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-10-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129220906","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}
引用次数: 91
Contracts for first-class classes 一等类的合同
Pub Date : 2010-10-18 DOI: 10.1145/1869631.1869642
T. Strickland, M. Felleisen
First-class classes add expressive power to class-based object-oriented languages. Most importantly, programmers can abstract over common scenarios with first-class classes. When it comes to behavioral software contracts, however, first-class classes pose significant challenges. In this paper, we present the first contract system for a programming language with first-class classes. The design has been implemented for Racket, which supports first-class classes and which implements mixins and traits as syntactic sugar. We expect that our experience also applies to languages with native mixins and/or traits.
一级类为基于类的面向对象语言增加了表达能力。最重要的是,程序员可以用一等类抽象通用场景。然而,当涉及到行为软件契约时,一等类带来了重大挑战。本文给出了具有一等类的程序设计语言的第一个契约系统。该设计已经为Racket实现,它支持一级类,并将mixins和trait作为语法糖来实现。我们希望我们的经验也适用于带有本地mixins和/或特性的语言。
{"title":"Contracts for first-class classes","authors":"T. Strickland, M. Felleisen","doi":"10.1145/1869631.1869642","DOIUrl":"https://doi.org/10.1145/1869631.1869642","url":null,"abstract":"First-class classes add expressive power to class-based object-oriented languages. Most importantly, programmers can abstract over common scenarios with first-class classes. When it comes to behavioral software contracts, however, first-class classes pose significant challenges. In this paper, we present the first contract system for a programming language with first-class classes. The design has been implemented for Racket, which supports first-class classes and which implements mixins and traits as syntactic sugar. We expect that our experience also applies to languages with native mixins and/or traits.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"6 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-10-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132768896","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}
引用次数: 32
Optimizing dynamic dispatch with fine-grained state tracking 使用细粒度状态跟踪优化动态调度
Pub Date : 2010-10-18 DOI: 10.1145/1869631.1869634
Salikh Zakirov, S. Chiba, Etsuya Shibayama
Dynamic mixin is a construct available in Ruby and other dynamic languages. It can be used as a base to implement a range of programming paradigms, such as dynamic aspect-oriented programming and context-oriented programming. However, the performance characteristics of current implementation of dynamic mixin in Ruby leaves much to be desired under condition of frequent dynamic mixin operations, global method cache and inline cache misses incur significant overhead. In this work we implemented fine-grained state tracking for CRuby 1. and were able to improve performance by more than six times on the microbenchmark exercising extreme case flowing 4 times to global method cache clearing, 28% to fine-grained state tracking and further 12% to inline cache miss elimination by caching alternating states. We demonstrated a small application using dynamic mixins that gets 48% improvement in performance from our techniques. We also implemented in C a more general delegation object models and proposed an algorithm of thread-local caching, which allows to reduce inline cache misses while permitting thread-local delegation changes.
动态mixin是Ruby和其他动态语言中可用的结构。它可以用作实现一系列编程范例的基础,例如动态面向方面编程和面向上下文编程。然而,在频繁的动态混合操作条件下,Ruby中当前动态混合实现的性能特征还有很多需要改进的地方,全局方法缓存和内联缓存丢失会导致显著的开销。在这项工作中,我们为CRuby 1实现了细粒度的状态跟踪。并且能够在微基准测试中提高6倍以上的性能,在极端情况下,全局方法缓存清理提高了4倍,细粒度状态跟踪提高了28%,通过缓存交替状态消除内联缓存缺失提高了12%。我们演示了一个使用动态mixins的小应用程序,该应用程序的性能通过我们的技术提高了48%。我们还在C语言中实现了一个更通用的委托对象模型,并提出了一个线程本地缓存算法,该算法允许在允许线程本地委托更改的同时减少内联缓存丢失。
{"title":"Optimizing dynamic dispatch with fine-grained state tracking","authors":"Salikh Zakirov, S. Chiba, Etsuya Shibayama","doi":"10.1145/1869631.1869634","DOIUrl":"https://doi.org/10.1145/1869631.1869634","url":null,"abstract":"Dynamic mixin is a construct available in Ruby and other dynamic languages. It can be used as a base to implement a range of programming paradigms, such as dynamic aspect-oriented programming and context-oriented programming. However, the performance characteristics of current implementation of dynamic mixin in Ruby leaves much to be desired under condition of frequent dynamic mixin operations, global method cache and inline cache misses incur significant overhead. In this work we implemented fine-grained state tracking for CRuby 1. and were able to improve performance by more than six times on the microbenchmark exercising extreme case flowing 4 times to global method cache clearing, 28% to fine-grained state tracking and further 12% to inline cache miss elimination by caching alternating states. We demonstrated a small application using dynamic mixins that gets 48% improvement in performance from our techniques. We also implemented in C a more general delegation object models and proposed an algorithm of thread-local caching, which allows to reduce inline cache misses while permitting thread-local delegation changes.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"54 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-10-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114622383","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
Controlling dynamic module composition through an extensible meta-level API 通过可扩展的元级API控制动态模块组合
Pub Date : 2010-10-18 DOI: 10.1145/1869631.1869641
Eyvind W. Axelsen, Stein Krogdahl, B. Møller-Pedersen
In addition to traditional object-oriented (OO) concepts such as inheritance and polymorphism, several modularization and composition mechanisms like e.g. traits, mixins and virtual classes have emerged. The Package Template mechanism is another attempt at providing a flexible mechanism for modularization, composition and adaption. Dynamic languages have traditionally employed strong support for meta-programming, with hooks to control OO concepts such as method invocation and object construction, by utilizing meta-classes and meta-object protocols. In this work, we attempt to bring a corresponding degree of meta-level control to composition primitives, with a concrete starting point in the package template mechanism as developed for the dynamic language Groovy. We wish to support a wide range of possible composition semantics, and to make such choices available to the developer through a meta-level API. This API should be extensible, and the semantic variations should be applied within well-defined scopes.
除了传统的面向对象(OO)概念,如继承和多态性之外,还出现了一些模块化和组合机制,如特征、混合和虚拟类。包模板机制是为模块化、组合和自适应提供灵活机制的另一种尝试。动态语言传统上对元编程有很强的支持,通过利用元类和元对象协议,用钩子来控制OO概念,比如方法调用和对象构造。在这项工作中,我们试图为组合原语带来相应程度的元级控制,具体的起点是为动态语言Groovy开发的包模板机制。我们希望支持广泛的可能的组合语义,并通过元级API为开发人员提供这些选择。这个API应该是可扩展的,语义变化应该在定义良好的范围内应用。
{"title":"Controlling dynamic module composition through an extensible meta-level API","authors":"Eyvind W. Axelsen, Stein Krogdahl, B. Møller-Pedersen","doi":"10.1145/1869631.1869641","DOIUrl":"https://doi.org/10.1145/1869631.1869641","url":null,"abstract":"In addition to traditional object-oriented (OO) concepts such as inheritance and polymorphism, several modularization and composition mechanisms like e.g. traits, mixins and virtual classes have emerged. The Package Template mechanism is another attempt at providing a flexible mechanism for modularization, composition and adaption.\u0000 Dynamic languages have traditionally employed strong support for meta-programming, with hooks to control OO concepts such as method invocation and object construction, by utilizing meta-classes and meta-object protocols.\u0000 In this work, we attempt to bring a corresponding degree of meta-level control to composition primitives, with a concrete starting point in the package template mechanism as developed for the dynamic language Groovy. We wish to support a wide range of possible composition semantics, and to make such choices available to the developer through a meta-level API. This API should be extensible, and the semantic variations should be applied within well-defined scopes.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"113 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-10-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129662824","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
Experiences with an icon-like expression evaluation system 使用类似图标的表达评估系统的经验
Pub Date : 2010-10-18 DOI: 10.1145/1869631.1869640
L. Tratt
The design of the Icon programming language's expression evaluation system, which can perform limited backtracking, was unique amongst imperative programming languages when created. In this paper I explain and critique the original Icon design and show how a similar system can be integrated into a modern dynamically typed language. Finally I detail my experiences of this system and offer suggestions for the lessons to be learned from it.
Icon编程语言的表达式评估系统的设计可以执行有限的回溯,在命令式编程语言中是独一无二的。在本文中,我解释并批判了最初的Icon设计,并展示了如何将类似的系统集成到现代动态类型语言中。最后详细阐述了我在该系统中的经验,并提出了一些值得借鉴的建议。
{"title":"Experiences with an icon-like expression evaluation system","authors":"L. Tratt","doi":"10.1145/1869631.1869640","DOIUrl":"https://doi.org/10.1145/1869631.1869640","url":null,"abstract":"The design of the Icon programming language's expression evaluation system, which can perform limited backtracking, was unique amongst imperative programming languages when created. In this paper I explain and critique the original Icon design and show how a similar system can be integrated into a modern dynamically typed language. Finally I detail my experiences of this system and offer suggestions for the lessons to be learned from it.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"96 3","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2010-10-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121012471","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
Beyond static and dynamic scope 超越静态和动态范围
Pub Date : 2009-10-26 DOI: 10.1145/1640134.1640137
É. Tanter
Traditional treatment of scoping in programming languages considers two opposite semantics: static scoping, where the scope of a binding is a block of program text, and dynamic scoping, where a binding is in effect during the whole reduction of an expression to a value. Static scoping and dynamic scoping are however but two points in the design space of scoping mechanisms. As a result, most proposed language mechanisms that rely on some notion of scoping, such as variable bindings of course, but also more exotic ones like aspects and mixin layers, adopt either one or the other semantics. As it turns out, these two semantics are sometimes too extreme, and a mixture of both is needed. To achieve this, language designers and/or programmers have to resort to ad hoc solutions. We present a general scoping model that simply expresses static and dynamic scoping, and that goes further by allowing fine-grained exploration of the design space of scoping. The model, called scoping strategies, gives precise control over propagation and activation of language mechanisms. While we have already studied it for aspects, we hereby show that the model is not restricted to aspects, by treating in depth its application to the most standard kind of adaptation: variable bindings. We also briefly discuss its application to mixin layers, and program monitoring. We believe that research in programming language constructs can benefit from a more flexible notion of scoping that goes beyond the static/dynamic dichotomy.
在编程语言中,对作用域的传统处理考虑两种相反的语义:静态作用域,其中绑定的作用域是程序文本块;动态作用域,其中绑定在将表达式还原为值的整个过程中有效。然而,静态作用域和动态作用域只是作用域机制设计空间中的两点。因此,大多数依赖于作用域概念的语言机制(当然包括变量绑定)以及更奇特的语言机制(如方面和混合层)要么采用其中一种语义,要么采用另一种语义。事实证明,这两种语义有时过于极端,需要两者的混合。为了实现这一点,语言设计者和/或程序员不得不求助于特别的解决方案。我们提出了一个通用的作用域模型,它简单地表示静态和动态作用域,并且允许对作用域的设计空间进行细粒度的探索。该模型称为作用域策略,它对语言机制的传播和激活提供了精确的控制。虽然我们已经对方面进行了研究,但我们在此通过深入研究其在最标准的一种自适应:变量绑定中的应用,表明该模型并不局限于方面。我们还简要讨论了它在混合层和程序监控中的应用。我们相信,编程语言结构的研究可以受益于超越静态/动态二分法的更灵活的作用域概念。
{"title":"Beyond static and dynamic scope","authors":"É. Tanter","doi":"10.1145/1640134.1640137","DOIUrl":"https://doi.org/10.1145/1640134.1640137","url":null,"abstract":"Traditional treatment of scoping in programming languages considers two opposite semantics: static scoping, where the scope of a binding is a block of program text, and dynamic scoping, where a binding is in effect during the whole reduction of an expression to a value. Static scoping and dynamic scoping are however but two points in the design space of scoping mechanisms. As a result, most proposed language mechanisms that rely on some notion of scoping, such as variable bindings of course, but also more exotic ones like aspects and mixin layers, adopt either one or the other semantics. As it turns out, these two semantics are sometimes too extreme, and a mixture of both is needed. To achieve this, language designers and/or programmers have to resort to ad hoc solutions. We present a general scoping model that simply expresses static and dynamic scoping, and that goes further by allowing fine-grained exploration of the design space of scoping. The model, called scoping strategies, gives precise control over propagation and activation of language mechanisms. While we have already studied it for aspects, we hereby show that the model is not restricted to aspects, by treating in depth its application to the most standard kind of adaptation: variable bindings. We also briefly discuss its application to mixin layers, and program monitoring. We believe that research in programming language constructs can benefit from a more flexible notion of scoping that goes beyond the static/dynamic dichotomy.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"27 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116977063","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}
引用次数: 32
Contracts for first-class modules 一级模块的契约
Pub Date : 2009-10-26 DOI: 10.1145/1640134.1640140
T. Strickland, M. Felleisen
Behavioral software contracts express properties concerning the flow of values across component (modules, classes, etc) interfaces. These properties are often beyond the reach of theorem provers and are therefore monitored at run-time. When the monitor discovers a contract violation, it raises an exception that simultaneously pinpoints the contract violator and explains the nature of the violation. Currently contract monitoring assumes static module interfaces. Specifically, the contract compiler partitions a contract into disjoint obligations for the static modules that communicate to an interface. At run-time, the information is used for catching and explaining contract violations. While static modules suffice for many situations, first-class modules - such as the units provided by PLT Scheme - support the dynamic and multiple linking that is often required in open software systems. The problem is, of course, that in such a world, it becomes impossible to tell from the source program alone which components have agreed to which contracts. In this paper, we develop the semantic framework of monitoring contracts for dynamic modules. We establish the internal consistency of the semantics, and we sketch an implementation based on our experience of equipping PLT Scheme with such contracts.
行为软件契约表达了与跨组件(模块、类等)接口的值流有关的属性。这些属性通常超出定理证明者的范围,因此在运行时进行监视。当监视器发现违反合同时,它会引发一个异常,该异常同时指出违反合同的人并解释违反合同的性质。目前契约监控采用静态模块接口。具体来说,契约编译器将契约划分为与接口通信的静态模块的不相交义务。在运行时,这些信息用于捕获和解释契约违反。虽然静态模块足以满足许多情况,但一流模块(例如PLT Scheme提供的单元)支持开放软件系统中经常需要的动态和多重链接。当然,问题是,在这样一个世界中,不可能仅从源程序中判断哪些组件同意了哪些合同。本文开发了动态模块监控契约的语义框架。我们建立了语义的内部一致性,并根据我们为PLT方案配备这种契约的经验,绘制了一个实现草图。
{"title":"Contracts for first-class modules","authors":"T. Strickland, M. Felleisen","doi":"10.1145/1640134.1640140","DOIUrl":"https://doi.org/10.1145/1640134.1640140","url":null,"abstract":"Behavioral software contracts express properties concerning the flow of values across component (modules, classes, etc) interfaces. These properties are often beyond the reach of theorem provers and are therefore monitored at run-time. When the monitor discovers a contract violation, it raises an exception that simultaneously pinpoints the contract violator and explains the nature of the violation.\u0000 Currently contract monitoring assumes static module interfaces. Specifically, the contract compiler partitions a contract into disjoint obligations for the static modules that communicate to an interface. At run-time, the information is used for catching and explaining contract violations. While static modules suffice for many situations, first-class modules - such as the units provided by PLT Scheme - support the dynamic and multiple linking that is often required in open software systems. The problem is, of course, that in such a world, it becomes impossible to tell from the source program alone which components have agreed to which contracts.\u0000 In this paper, we develop the semantic framework of monitoring contracts for dynamic modules. We establish the internal consistency of the semantics, and we sketch an implementation based on our experience of equipping PLT Scheme with such contracts.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"86 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114839925","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
Context-oriented software transactional memory in common lisp 通用lisp中面向上下文的软件事务内存
Pub Date : 2009-10-26 DOI: 10.1145/1640134.1640144
Pascal Costanza, Charlotte Herzeel, T. D'Hondt
Software transactional memory (STM) is a promising approach for coordinating concurrent threads, for which many implementation strategies are currently being researched. Although some first steps exist to ease experimenting with different strategies, this still remains a relatively complex and cumbersome task. The reason is that software transactions require STM-specific dynamic crosscutting adaptations, but this is not accounted for in current STM implementations. This paper presents CSTM, an STM framework based on Context-oriented Progamming, in which transactions are modelled as dynamically scoped layer activations. It enables expressing transactional variable accesses as user-defined crosscutting concerns, without requiring invasive changes in the rest of a program. This paper presents a proof-of-concept implementation based on ContextL for Common Lisp, along with example STM strategies and preliminary benchmarks, and introduces some of ContextL's unique features for context-dependent variable accesses.
软件事务性内存(STM)是一种很有前途的协调并发线程的方法,目前正在研究许多实现策略。尽管已经有了一些初步的步骤来简化不同策略的试验,但这仍然是一项相对复杂和繁琐的任务。原因是软件事务需要特定于STM的动态横切适应,但是在当前的STM实现中没有考虑到这一点。本文提出了CSTM,一个基于面向上下文编程的STM框架,其中事务被建模为动态作用域的层激活。它支持将事务变量访问表示为用户定义的横切关注点,而不需要在程序的其余部分进行侵入性更改。本文提出了一个基于ContextL的公共Lisp的概念验证实现,以及示例STM策略和初步基准测试,并介绍了ContextL用于上下文相关变量访问的一些独特功能。
{"title":"Context-oriented software transactional memory in common lisp","authors":"Pascal Costanza, Charlotte Herzeel, T. D'Hondt","doi":"10.1145/1640134.1640144","DOIUrl":"https://doi.org/10.1145/1640134.1640144","url":null,"abstract":"Software transactional memory (STM) is a promising approach for coordinating concurrent threads, for which many implementation strategies are currently being researched. Although some first steps exist to ease experimenting with different strategies, this still remains a relatively complex and cumbersome task. The reason is that software transactions require STM-specific dynamic crosscutting adaptations, but this is not accounted for in current STM implementations. This paper presents CSTM, an STM framework based on Context-oriented Progamming, in which transactions are modelled as dynamically scoped layer activations. It enables expressing transactional variable accesses as user-defined crosscutting concerns, without requiring invasive changes in the rest of a program. This paper presents a proof-of-concept implementation based on ContextL for Common Lisp, along with example STM strategies and preliminary benchmarks, and introduces some of ContextL's unique features for context-dependent variable accesses.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"30 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122066841","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
The ruby intermediate language ruby中间语言
Pub Date : 2009-10-26 DOI: 10.1145/1640134.1640148
Michael Furr, Jong-hoon An, J. Foster, M. Hicks
Ruby is a popular, dynamic scripting language that aims to "feel natural to programmers" and give users the "freedom to choose" among many different ways of doing the same thing. While this arguably makes programming in Ruby easier, it makes it hard to build analysis and transformation tools that operate on Ruby source code. In this paper, we present the Ruby Intermediate Language (RIL), a Ruby front-end and intermediate representation that addresses these. RIL includes an extensible GLR parser for Ruby, and an automatic translation into an easy-to-analyze intermediate form. This translation eliminates redundant language constructs, unravels the often subtle ordering among side effecting operations, and makes implicit interpreter operations explicit. We also describe several additional useful features of RIL, such as a dynamic instrumentation library for profiling source code and a dataflow analysis engine. We demonstrate the usefulness of RIL by presenting a static and dynamic analysis to eliminate null pointer errors in Ruby programs. We hope that RIL's features will enable others to more easily build analysis tools for Ruby, and that our design will inspire the of similar frameworks for other dynamic languages.
Ruby是一种流行的动态脚本语言,旨在“让程序员感觉自然”,并让用户在许多不同的方法中“自由选择”。虽然可以说这使得用Ruby编程更容易,但却使得构建在Ruby源代码上运行的分析和转换工具变得困难。在本文中,我们提出了Ruby中间语言(RIL),一种解决这些问题的Ruby前端和中间表示。RIL包括一个用于Ruby的可扩展GLR解析器,以及一个自动转换成易于分析的中间形式的功能。这种翻译消除了冗余的语言结构,解开了副作用操作之间通常微妙的顺序,并使隐式解释器操作显式。我们还描述了RIL的几个其他有用的特性,例如用于分析源代码的动态工具库和数据流分析引擎。我们通过展示静态和动态分析来消除Ruby程序中的空指针错误,从而展示了RIL的有用性。我们希望RIL的特性能让其他人更容易地为Ruby构建分析工具,我们的设计也能启发其他动态语言的类似框架。
{"title":"The ruby intermediate language","authors":"Michael Furr, Jong-hoon An, J. Foster, M. Hicks","doi":"10.1145/1640134.1640148","DOIUrl":"https://doi.org/10.1145/1640134.1640148","url":null,"abstract":"Ruby is a popular, dynamic scripting language that aims to \"feel natural to programmers\" and give users the \"freedom to choose\" among many different ways of doing the same thing. While this arguably makes programming in Ruby easier, it makes it hard to build analysis and transformation tools that operate on Ruby source code. In this paper, we present the Ruby Intermediate Language (RIL), a Ruby front-end and intermediate representation that addresses these. RIL includes an extensible GLR parser for Ruby, and an automatic translation into an easy-to-analyze intermediate form. This translation eliminates redundant language constructs, unravels the often subtle ordering among side effecting operations, and makes implicit interpreter operations explicit. We also describe several additional useful features of RIL, such as a dynamic instrumentation library for profiling source code and a dataflow analysis engine. We demonstrate the usefulness of RIL by presenting a static and dynamic analysis to eliminate null pointer errors in Ruby programs. We hope that RIL's features will enable others to more easily build analysis tools for Ruby, and that our design will inspire the of similar frameworks for other dynamic languages.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"122 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129820333","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}
引用次数: 25
Directing JavaScript with arrows 用箭头引导JavaScript
Pub Date : 2009-10-26 DOI: 10.1145/1640134.1640143
Yit Phang Khoo, M. Hicks, J. Foster, Vibha Sazawal
JavaScript programmers make extensive use of event-driven programming to help build responsive web applications. However, standard approaches to sequencing events are messy, and often lead to code that is difficult to understand and maintain. We have found that arrows, a generalization of monads, are an elegant solution to this problem. Arrows allow us to easily write asynchronous programs in small, modular units of code, and flexibly compose them in many different ways, while nicely abstracting the details of asynchronous program composition. In this paper, we present Arrowlets, a new JavaScript library that offers arrows to the everyday JavaScript programmer. We show how to use Arrowlets to construct a variety of state machines, including state machines that branch and loop. We also demonstrate how Arrowlets separate computation from composition with examples such as a drag-and-drop handler and a bubblesort animation.
JavaScript程序员广泛使用事件驱动编程来帮助构建响应式web应用程序。然而,对事件排序的标准方法是混乱的,并且经常导致难以理解和维护的代码。我们发现,单子的一般化的箭头是解决这个问题的一个很好的方法。arrow允许我们轻松地用小的、模块化的代码单元编写异步程序,并以许多不同的方式灵活地组合它们,同时很好地抽象了异步程序组合的细节。在本文中,我们介绍了Arrowlets,这是一个新的JavaScript库,为日常JavaScript程序员提供箭头。我们将展示如何使用arrowlet构造各种状态机,包括分支和循环的状态机。我们还通过拖放处理程序和冒泡排序动画等示例演示了Arrowlets如何将计算与组合分开。
{"title":"Directing JavaScript with arrows","authors":"Yit Phang Khoo, M. Hicks, J. Foster, Vibha Sazawal","doi":"10.1145/1640134.1640143","DOIUrl":"https://doi.org/10.1145/1640134.1640143","url":null,"abstract":"JavaScript programmers make extensive use of event-driven programming to help build responsive web applications. However, standard approaches to sequencing events are messy, and often lead to code that is difficult to understand and maintain. We have found that arrows, a generalization of monads, are an elegant solution to this problem. Arrows allow us to easily write asynchronous programs in small, modular units of code, and flexibly compose them in many different ways, while nicely abstracting the details of asynchronous program composition. In this paper, we present Arrowlets, a new JavaScript library that offers arrows to the everyday JavaScript programmer. We show how to use Arrowlets to construct a variety of state machines, including state machines that branch and loop. We also demonstrate how Arrowlets separate computation from composition with examples such as a drag-and-drop handler and a bubblesort animation.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"31 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2009-10-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114338811","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}
引用次数: 21
期刊
Dynamic Languages Symposium
全部 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