首页 > 最新文献

Dynamic Languages Symposium最新文献

英文 中文
Whalesong: running racket in the browser 鲸鱼:在浏览器中运行球拍
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508172
Daniel Yoo, S. Krishnamurthi
JavaScript is the language of the ubiquitous Web, but it only poorly supports event-driven functional programs due to its single-threaded, asynchronous nature and lack of rich control flow operators. We present Whalesong, a compiler from Racket that generates JavaScript code that masks these problems. We discuss the implementation strategy using delimited continuations, an interface to the DOM, and an FFI for adapting JavaScript libraries to add new platform-dependent reactive features. In the process, we also describe extensions to Racket's functional event-driven programming model. We also briefly discuss the implementation details.
JavaScript是无处不在的Web语言,但由于其单线程、异步特性和缺乏丰富的控制流操作符,它只能很差地支持事件驱动的函数式程序。我们介绍Whalesong,这是一个来自Racket的编译器,它生成的JavaScript代码可以掩盖这些问题。我们讨论了使用分隔的延续、DOM接口和FFI来调整JavaScript库以添加新的依赖于平台的响应式特性的实现策略。在这个过程中,我们还描述了对Racket的函数式事件驱动编程模型的扩展。我们还简要讨论了实现细节。
{"title":"Whalesong: running racket in the browser","authors":"Daniel Yoo, S. Krishnamurthi","doi":"10.1145/2508168.2508172","DOIUrl":"https://doi.org/10.1145/2508168.2508172","url":null,"abstract":"JavaScript is the language of the ubiquitous Web, but it only poorly supports event-driven functional programs due to its single-threaded, asynchronous nature and lack of rich control flow operators. We present Whalesong, a compiler from Racket that generates JavaScript code that masks these problems. We discuss the implementation strategy using delimited continuations, an interface to the DOM, and an FFI for adapting JavaScript libraries to add new platform-dependent reactive features. In the process, we also describe extensions to Racket's functional event-driven programming model. We also briefly discuss the implementation details.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"26 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114876814","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
All about the with statement in JavaScript: removing with statements in JavaScript applications 关于JavaScript中的with语句:删除JavaScript应用程序中的with语句
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508173
Changhee Park, Hongki Lee, Sukyoung Ryu
The with statement in JavaScript makes static analysis of JavaScript applications difficult by introducing a new scope at run time and thus invalidating lexical scoping. Therefore, many static approaches to JavaScript program analysis and the strict mode of ECMAScript 5 simply disallow the with statement. To justify exclusion of the with statement, we should better understand the actual usage patterns of the with statement. In this paper, we present the usage patterns of the with statement in real-world JavaScript applications currently used in the 898 most popular web sites. We investigate whether we can rewrite the with statements in each pattern to other statements not using the with statement. We show that we can rewrite all the static occurrences of the with statement that do not have any dynamic code generating functions. Even though the rewriting process is not applicable to any dynamically generated with statements, our results are still promising. Because all the static approaches that disallow the with statement also disallow dynamic code generation, such static approaches can allow the with statement using our rewriting process. We formally present our rewriting strategy, provide its implementation, and show its faithfulness using extensive testing. We believe that removing with statements will simplify JavaScript program analysis designs without considering dynamic scope introduction while imposing fewer syntactic restrictions.
JavaScript中的with语句在运行时引入了一个新的作用域,从而使词法作用域失效,从而使JavaScript应用程序的静态分析变得困难。因此,许多JavaScript程序分析的静态方法和ECMAScript 5的严格模式都不允许使用with语句。为了证明排除with语句是正确的,我们应该更好地理解with语句的实际使用模式。在本文中,我们展示了在898个最流行的网站中使用的真实JavaScript应用程序中with语句的使用模式。我们研究是否可以将每种模式中的with语句重写为不使用with语句的其他语句。我们展示了可以重写没有任何动态代码生成函数的with语句的所有静态出现。尽管重写过程不适用于任何动态生成的with语句,但我们的结果仍然很有希望。因为所有不允许使用with语句的静态方法也不允许动态代码生成,所以这些静态方法可以使用我们的重写过程来允许使用with语句。我们正式提出了我们的重写策略,提供了它的实现,并通过广泛的测试展示了它的可靠性。我们相信删除with语句将简化JavaScript程序分析设计,而无需考虑引入动态作用域,同时减少语法限制。
{"title":"All about the with statement in JavaScript: removing with statements in JavaScript applications","authors":"Changhee Park, Hongki Lee, Sukyoung Ryu","doi":"10.1145/2508168.2508173","DOIUrl":"https://doi.org/10.1145/2508168.2508173","url":null,"abstract":"The with statement in JavaScript makes static analysis of JavaScript applications difficult by introducing a new scope at run time and thus invalidating lexical scoping. Therefore, many static approaches to JavaScript program analysis and the strict mode of ECMAScript 5 simply disallow the with statement. To justify exclusion of the with statement, we should better understand the actual usage patterns of the with statement.\u0000 In this paper, we present the usage patterns of the with statement in real-world JavaScript applications currently used in the 898 most popular web sites. We investigate whether we can rewrite the with statements in each pattern to other statements not using the with statement. We show that we can rewrite all the static occurrences of the with statement that do not have any dynamic code generating functions. Even though the rewriting process is not applicable to any dynamically generated with statements, our results are still promising. Because all the static approaches that disallow the with statement also disallow dynamic code generation, such static approaches can allow the with statement using our rewriting process. We formally present our rewriting strategy, provide its implementation, and show its faithfulness using extensive testing. We believe that removing with statements will simplify JavaScript program analysis designs without considering dynamic scope introduction while imposing fewer syntactic restrictions.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"23 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115044603","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
Improved type specialization for dynamic scripting languages 改进了动态脚本语言的类型专门化
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508177
Madhukar N. Kedlaya, Jared Roesch, Behnam Robatmili, Mehrdad Reshadi, B. Hardekopf
Type feedback and type inference are two common methods used to optimize dynamic languages such as JavaScript. Each of these methods has its own strengths and weaknesses, and we propose that each can benefit from the other if combined in the right way. We explore the interdependency between these two methods and propose two novel ways to combine them in order to significantly increase their aggregate benefit and decrease their aggregate overhead. In our proposed strategy, an initial type inference pass is applied that can reduce type feedback overhead by enabling more intelligent placement of profiling hooks. This initial type inference pass is novel in the literature. After profiling, a final type inference pass uses the type information from profiling to generate efficient code. While this second pass is not novel, we significantly improve its effectiveness in a novel way by feeding the type inference pass information about the function signature, i.e., the types of the function's arguments for aspecific function invocation. Our results show significant speedups when using these low-overhead strategies, ranging from 1.2x to 4x over an implementation that does not perform type feedback or type inference based optimizations. Our experiments are carried out across a wide range of traditional benchmarks and realistic web applications. The results also show an average reduction of 23.5% in the size of the profiled data for these benchmarks.
类型反馈和类型推断是优化JavaScript等动态语言的两种常用方法。每一种方法都有自己的优点和缺点,我们认为,如果以正确的方式结合起来,每一种方法都可以从另一种方法中受益。我们探讨了这两种方法之间的相互依赖性,并提出了两种新的方法来结合它们,以显着提高它们的总效益和降低它们的总开销。在我们提出的策略中,应用了一个初始类型推断通道,通过支持更智能地放置分析钩子来减少类型反馈开销。这种初始类型推理方法在文献中是新颖的。在分析之后,最后的类型推断传递使用分析中的类型信息来生成高效的代码。虽然这第二次传递并不新颖,但我们通过提供关于函数签名的类型推断传递信息(即特定函数调用的函数参数的类型),以一种新颖的方式显著提高了它的有效性。我们的结果显示,当使用这些低开销策略时,速度比不执行类型反馈或基于类型推断的优化的实现提高了1.2倍到4倍。我们的实验是在广泛的传统基准和现实的web应用程序中进行的。结果还显示,这些基准测试的概要数据大小平均减少了23.5%。
{"title":"Improved type specialization for dynamic scripting languages","authors":"Madhukar N. Kedlaya, Jared Roesch, Behnam Robatmili, Mehrdad Reshadi, B. Hardekopf","doi":"10.1145/2508168.2508177","DOIUrl":"https://doi.org/10.1145/2508168.2508177","url":null,"abstract":"Type feedback and type inference are two common methods used to optimize dynamic languages such as JavaScript. Each of these methods has its own strengths and weaknesses, and we propose that each can benefit from the other if combined in the right way. We explore the interdependency between these two methods and propose two novel ways to combine them in order to significantly increase their aggregate benefit and decrease their aggregate overhead. In our proposed strategy, an initial type inference pass is applied that can reduce type feedback overhead by enabling more intelligent placement of profiling hooks. This initial type inference pass is novel in the literature. After profiling, a final type inference pass uses the type information from profiling to generate efficient code. While this second pass is not novel, we significantly improve its effectiveness in a novel way by feeding the type inference pass information about the function signature, i.e., the types of the function's arguments for aspecific function invocation. Our results show significant speedups when using these low-overhead strategies, ranging from 1.2x to 4x over an implementation that does not perform type feedback or type inference based optimizations. Our experiments are carried out across a wide range of traditional benchmarks and realistic web applications. The results also show an average reduction of 23.5% in the size of the profiled data for these benchmarks.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130306150","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}
引用次数: 24
TeJaS: retrofitting type systems for JavaScript TeJaS:为JavaScript改进类型系统
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508170
Benjamin S. Lerner, J. Politz, Arjun Guha, S. Krishnamurthi
JavaScript programs vary widely in functionality, complexity, and use, and analyses of these programs must accommodate such variations. Type-based analyses are typically the simplest such analyses, but due to the language's subtle idioms and many application-specific needs---such as ensuring general-purpose type correctness, security properties, or proper library usage---we have found that a single type system does not suffice for all purposes. However, these varied uses still share many reusable common elements. In this paper we present TeJaS, a framework for building type systems for JavaScript. TeJaS has been engineered modularly to encourage experimentation. Its initial type environment is reified, to admit easy modeling of the various execution contexts of JavaScript programs, and its type language and typing rules are extensible, to enable variations of the type system to be constructed easily. The paper presents the base TeJaS type system, which performs traditional type-checking for JavaScript. Because JavaScript demands complex types, we explain several design decisions to improve user ergonomics. We then describe TeJaS's modular structure, and illustrate it by reconstructing the essence of a very different type system for JavaScript. Systems built from TeJaS have been applied to several real-world, third-party JavaScript programs.
JavaScript程序在功能、复杂性和用途方面变化很大,对这些程序的分析必须适应这些变化。基于类型的分析通常是此类分析中最简单的,但是由于语言的微妙习惯用法和许多特定于应用程序的需求——例如确保通用类型正确性、安全属性或正确的库使用——我们发现单一类型系统不能满足所有目的。然而,这些不同的用途仍然共享许多可重用的公共元素。在本文中,我们介绍了TeJaS,一个为JavaScript构建类型系统的框架。光辉战机被模块化设计以鼓励试验。它的初始类型环境是具体化的,这样可以方便地对JavaScript程序的各种执行上下文进行建模;它的类型语言和类型规则是可扩展的,这样可以方便地构造类型系统的变体。本文介绍了基本的TeJaS类型系统,该系统为JavaScript执行传统的类型检查。因为JavaScript需要复杂的类型,我们解释了几个设计决策来改进用户人机工程学。然后,我们描述了TeJaS的模块化结构,并通过重构一个非常不同的JavaScript类型系统的本质来说明它。由TeJaS构建的系统已经应用于几个现实世界的第三方JavaScript程序。
{"title":"TeJaS: retrofitting type systems for JavaScript","authors":"Benjamin S. Lerner, J. Politz, Arjun Guha, S. Krishnamurthi","doi":"10.1145/2508168.2508170","DOIUrl":"https://doi.org/10.1145/2508168.2508170","url":null,"abstract":"JavaScript programs vary widely in functionality, complexity, and use, and analyses of these programs must accommodate such variations. Type-based analyses are typically the simplest such analyses, but due to the language's subtle idioms and many application-specific needs---such as ensuring general-purpose type correctness, security properties, or proper library usage---we have found that a single type system does not suffice for all purposes. However, these varied uses still share many reusable common elements.\u0000 In this paper we present TeJaS, a framework for building type systems for JavaScript. TeJaS has been engineered modularly to encourage experimentation. Its initial type environment is reified, to admit easy modeling of the various execution contexts of JavaScript programs, and its type language and typing rules are extensible, to enable variations of the type system to be constructed easily.\u0000 The paper presents the base TeJaS type system, which performs traditional type-checking for JavaScript. Because JavaScript demands complex types, we explain several design decisions to improve user ergonomics. We then describe TeJaS's modular structure, and illustrate it by reconstructing the essence of a very different type system for JavaScript. Systems built from TeJaS have been applied to several real-world, third-party JavaScript programs.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"6 5 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121301777","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}
引用次数: 51
Polymorphic identifiers: uniform resource access in objective-smalltalk 多态标识符:objective-smalltalk中的统一资源访问
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508169
Marcel Weiher, R. Hirschfeld
In object-oriented programming, polymorphic dispatch of operations decouples clients from specific providers of services and allows implementations to be modified or substituted without affecting clients. The Uniform Access Principle (UAP) tries to extend these qualities to resource access by demanding that access to state be indistinguishable from access to operations. Despite language features supporting the UAP, the overall goal of substitutability has not been achieved for either alternative resources such as keyed storage, files or web pages, or for alternate access mechanisms: specific kinds of resources are bound to specific access mechanisms and vice versa. Changing storage or access patterns either requires changes to both clients and service providers and trying to maintain the UAP imposes significant penalties in terms of code-duplication and/or performance overhead. We propose introducing first class identifiers as polymorphic names for storage locations to solve these problems. With these Polymorphic Identifiers, we show that we can provide uniform access to a wide variety of resource types as well as storage and access mechanisms, whether parametrized or direct, without affecting client code, without causing code duplication or significant performance penalties.
在面向对象编程中,操作的多态调度将客户端与特定的服务提供者解耦,并允许在不影响客户端的情况下修改或替换实现。统一访问原则(UAP)通过要求对状态的访问与对操作的访问不可区分,试图将这些特性扩展到资源访问。尽管语言特性支持UAP,但替代资源(如键控存储、文件或网页)或替代访问机制的可替代性总体目标尚未实现:特定类型的资源绑定到特定的访问机制,反之亦然。更改存储或访问模式需要同时更改客户端和服务提供者,并且试图维护UAP会在代码复制和/或性能开销方面带来重大损失。我们建议引入第一类标识符作为存储位置的多态名称来解决这些问题。通过这些多态标识符,我们可以提供对各种资源类型以及存储和访问机制的统一访问,无论是参数化的还是直接的,而不会影响客户端代码,不会导致代码重复或显著的性能损失。
{"title":"Polymorphic identifiers: uniform resource access in objective-smalltalk","authors":"Marcel Weiher, R. Hirschfeld","doi":"10.1145/2508168.2508169","DOIUrl":"https://doi.org/10.1145/2508168.2508169","url":null,"abstract":"In object-oriented programming, polymorphic dispatch of operations decouples clients from specific providers of services and allows implementations to be modified or substituted without affecting clients.\u0000 The Uniform Access Principle (UAP) tries to extend these qualities to resource access by demanding that access to state be indistinguishable from access to operations. Despite language features supporting the UAP, the overall goal of substitutability has not been achieved for either alternative resources such as keyed storage, files or web pages, or for alternate access mechanisms: specific kinds of resources are bound to specific access mechanisms and vice versa. Changing storage or access patterns either requires changes to both clients and service providers and trying to maintain the UAP imposes significant penalties in terms of code-duplication and/or performance overhead.\u0000 We propose introducing first class identifiers as polymorphic names for storage locations to solve these problems. With these Polymorphic Identifiers, we show that we can provide uniform access to a wide variety of resource types as well as storage and access mechanisms, whether parametrized or direct, without affecting client code, without causing code duplication or significant performance penalties.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"9 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125153484","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
Efficient dynamic access analysis using JavaScript proxies 使用JavaScript代理的高效动态访问分析
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508176
M. Keil, Peter Thiemann
JSConTest introduced the notions of effect monitoring and dynamic effect inference for JavaScript. It enables the description of effects with path specifications resembling regular expressions. It is implemented by an offline source code transformation. To overcome the limitations of the JSConTest implementation, we redesigned and reimplemented effect monitoring by taking advantange of JavaScript proxies. Our new design avoids all drawbacks of the prior implementation. It guarantees full interposition; it is not restricted to a subset of JavaScript; it is self-maintaining; and its scalability to large programs is significantly better than with JSConTest. The improved scalability has two sources. First, the reimplementation is significantly faster than the original, transformation-based implementation. Second, the reimplementation relies on the fly-weight pattern and on trace reduction to conserve memory. Only the combination of these techniques enables monitoring and inference for large programs.
JSConTest为JavaScript引入了效果监控和动态效果推断的概念。它支持用类似正则表达式的路径规范描述效果。它是通过离线源代码转换实现的。为了克服JSConTest实现的局限性,我们利用JavaScript代理重新设计并重新实现了效果监控。我们的新设计避免了先前实现的所有缺点。它保证了充分的干预;它并不局限于JavaScript的一个子集;它是自我维持的;它对大型程序的可伸缩性明显优于JSConTest。改进的可伸缩性有两个来源。首先,重新实现比原始的基于转换的实现要快得多。其次,重实现依赖于飞权模式和跟踪减少来节省内存。只有这些技术的组合才能对大型程序进行监视和推断。
{"title":"Efficient dynamic access analysis using JavaScript proxies","authors":"M. Keil, Peter Thiemann","doi":"10.1145/2508168.2508176","DOIUrl":"https://doi.org/10.1145/2508168.2508176","url":null,"abstract":"JSConTest introduced the notions of effect monitoring and dynamic effect inference for JavaScript. It enables the description of effects with path specifications resembling regular expressions. It is implemented by an offline source code transformation.\u0000 To overcome the limitations of the JSConTest implementation, we redesigned and reimplemented effect monitoring by taking advantange of JavaScript proxies. Our new design avoids all drawbacks of the prior implementation. It guarantees full interposition; it is not restricted to a subset of JavaScript; it is self-maintaining; and its scalability to large programs is significantly better than with JSConTest.\u0000 The improved scalability has two sources. First, the reimplementation is significantly faster than the original, transformation-based implementation. Second, the reimplementation relies on the fly-weight pattern and on trace reduction to conserve memory. Only the combination of these techniques enables monitoring and inference for large programs.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"16 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"127347904","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
Optimizing MATLAB feval with dynamic techniques 用动态技术优化MATLAB仿真
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508174
Nurudeen Lameed, L. Hendren
MATLAB is a popular dynamic array-based language used by engineers, scientists and students worldwide. The built-in function feval is an important MATLAB feature for certain classes of numerical programs and solvers which benefit from having functions as parameters. Programmers may pass a function name or function handle to the solver and then the solver uses feval to indirectly call the function. In this paper, we show that there are significant performance overheads for function calls via feval, in both MATLAB interpreters and JITs. The paper then proposes, implements and compares two on-the-fly mechanisms for specialization of feval calls. The first approach uses on-stack replacement technology, as supported by McVM/McOSR. The second approach specializes calls of functions with feval using a combination of runtime input argument types and values. Experimental results on seven numerical solvers show that the techniques provide good performance improvements.
MATLAB是一种流行的基于动态数组的语言,被世界各地的工程师、科学家和学生使用。对于某些类型的数值程序和求解器来说,内置函数函数是MATLAB的一个重要特性,它得益于函数作为参数。程序员可以将函数名或函数句柄传递给求解器,然后求解器使用feval间接调用该函数。在本文中,我们展示了在MATLAB解释器和jit中通过eval进行函数调用的显著性能开销。然后提出、实现并比较了两种动态的eval调用专门化机制。第一种方法使用McVM/McOSR支持的堆栈上替换技术。第二种方法使用运行时输入参数类型和值的组合来专门化函数的eval调用。在7个数值解算器上的实验结果表明,该方法有较好的性能改进。
{"title":"Optimizing MATLAB feval with dynamic techniques","authors":"Nurudeen Lameed, L. Hendren","doi":"10.1145/2508168.2508174","DOIUrl":"https://doi.org/10.1145/2508168.2508174","url":null,"abstract":"MATLAB is a popular dynamic array-based language used by engineers, scientists and students worldwide. The built-in function feval is an important MATLAB feature for certain classes of numerical programs and solvers which benefit from having functions as parameters. Programmers may pass a function name or function handle to the solver and then the solver uses feval to indirectly call the function. In this paper, we show that there are significant performance overheads for function calls via feval, in both MATLAB interpreters and JITs. The paper then proposes, implements and compares two on-the-fly mechanisms for specialization of feval calls. The first approach uses on-stack replacement technology, as supported by McVM/McOSR. The second approach specializes calls of functions with feval using a combination of runtime input argument types and values. Experimental results on seven numerical solvers show that the techniques provide good performance improvements.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"35 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114227558","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
Type refinement for static analysis of JavaScript 用于JavaScript静态分析的类型细化
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508175
Vineeth Kashyap, J. Sarracino, J. Wagner, Ben Wiedermann, B. Hardekopf
Static analysis of JavaScript has proven useful for a variety of purposes, including optimization, error checking, security auditing, program refactoring, and more. We propose a technique called type refinement that can improve the precision of such static analyses for JavaScript without any discernible performance impact. Refinement is a known technique that uses the conditions in branch guards to refine the analysis information propagated along each branch path. The key insight of this paper is to recognize that JavaScript semantics include many implicit conditional checks on types, and that performing type refinement on these implicit checks provides significant benefit for analysis precision. To demonstrate the effectiveness of type refinement, we implement a static analysis tool for reporting potential type-errors in JavaScript programs. We provide an extensive empirical evaluation of type refinement using a benchmark suite containing a variety of JavaScript application domains, ranging from the standard performance benchmark suites (Sunspider and Octane), to open-source JavaScript applications, to machine-generated JavaScript via Emscripten. We show that type refinement can significantly improve analysis precision by up to 86% without affecting the performance of the analysis.
JavaScript的静态分析已被证明对各种目的都很有用,包括优化、错误检查、安全审计、程序重构等等。我们提出了一种称为类型细化的技术,它可以提高JavaScript静态分析的精度,而不会对性能产生任何明显的影响。细化是一种已知的技术,它使用分支保护中的条件来细化沿每个分支路径传播的分析信息。本文的关键观点是认识到JavaScript语义包括对类型的许多隐式条件检查,并且在这些隐式检查上执行类型细化为分析精度提供了显著的好处。为了演示类型细化的有效性,我们实现了一个静态分析工具,用于报告JavaScript程序中潜在的类型错误。我们使用包含各种JavaScript应用程序域的基准测试套件,从标准性能基准测试套件(Sunspider和Octane)到开源JavaScript应用程序,再到通过Emscripten机器生成的JavaScript,提供了广泛的类型优化经验评估。我们发现,在不影响分析性能的情况下,类型细化可以显著提高高达86%的分析精度。
{"title":"Type refinement for static analysis of JavaScript","authors":"Vineeth Kashyap, J. Sarracino, J. Wagner, Ben Wiedermann, B. Hardekopf","doi":"10.1145/2508168.2508175","DOIUrl":"https://doi.org/10.1145/2508168.2508175","url":null,"abstract":"Static analysis of JavaScript has proven useful for a variety of purposes, including optimization, error checking, security auditing, program refactoring, and more. We propose a technique called type refinement that can improve the precision of such static analyses for JavaScript without any discernible performance impact. Refinement is a known technique that uses the conditions in branch guards to refine the analysis information propagated along each branch path. The key insight of this paper is to recognize that JavaScript semantics include many implicit conditional checks on types, and that performing type refinement on these implicit checks provides significant benefit for analysis precision.\u0000 To demonstrate the effectiveness of type refinement, we implement a static analysis tool for reporting potential type-errors in JavaScript programs. We provide an extensive empirical evaluation of type refinement using a benchmark suite containing a variety of JavaScript application domains, ranging from the standard performance benchmark suites (Sunspider and Octane), to open-source JavaScript applications, to machine-generated JavaScript via Emscripten. We show that type refinement can significantly improve analysis precision by up to 86% without affecting the performance of the analysis.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"21 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115208460","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}
引用次数: 26
Cast insertion strategies for gradually-typed objects 为逐渐类型的对象强制转换插入策略
Pub Date : 2013-10-28 DOI: 10.1145/2508168.2508171
Esteban Allende, J. Fabry, É. Tanter
Gradual typing enables a smooth and progressive integration of static and dynamic typing. The semantics of a gradually-typed program is given by translation to an intermediate language with casts: runtime type checks that control the boundaries between statically- and dynamically-typed portions of a program. This paper studies the performance of different cast insertion strategies in the context of Gradualtalk, a gradually-typed Smalltalk. We first implement the strategy specified by Siek and Taha, which inserts casts at call sites. We then study the dual approach, which consists in performing casts in callees. Based on the observation that both strategies perform well in different scenarios, we design a hybrid strategy that combines the best of each approach. We evaluate these three strategies using both micro- and macro-benchmarks. We also discuss the impact of these strategies on memory, modularity, and inheritance. The hybrid strategy constitutes a promising cast insertion strategy for adding gradual types to existing dynamically-typed languages.
渐进式类型支持静态类型和动态类型的平滑渐进集成。渐变类型程序的语义是通过转换为带有强制类型转换的中间语言来给出的:运行时类型检查控制程序的静态类型部分和动态类型部分之间的边界。本文研究了渐进式Smalltalk中不同类型的强制转换插入策略的性能。我们首先实现Siek和Taha指定的策略,该策略在调用站点插入强制类型转换。然后我们研究了双重方法,它包括在调用中执行强制类型转换。基于对两种策略在不同场景下表现良好的观察,我们设计了一种混合策略,结合了每种方法的优点。我们使用微观和宏观基准来评估这三种策略。我们还讨论了这些策略对内存、模块化和继承的影响。混合策略构成了一种很有前途的强制转换插入策略,可以在现有的动态类型语言中添加渐进类型。
{"title":"Cast insertion strategies for gradually-typed objects","authors":"Esteban Allende, J. Fabry, É. Tanter","doi":"10.1145/2508168.2508171","DOIUrl":"https://doi.org/10.1145/2508168.2508171","url":null,"abstract":"Gradual typing enables a smooth and progressive integration of static and dynamic typing. The semantics of a gradually-typed program is given by translation to an intermediate language with casts: runtime type checks that control the boundaries between statically- and dynamically-typed portions of a program. This paper studies the performance of different cast insertion strategies in the context of Gradualtalk, a gradually-typed Smalltalk. We first implement the strategy specified by Siek and Taha, which inserts casts at call sites. We then study the dual approach, which consists in performing casts in callees. Based on the observation that both strategies perform well in different scenarios, we design a hybrid strategy that combines the best of each approach. We evaluate these three strategies using both micro- and macro-benchmarks. We also discuss the impact of these strategies on memory, modularity, and inheritance. The hybrid strategy constitutes a promising cast insertion strategy for adding gradual types to existing dynamically-typed languages.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"53 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2013-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132007939","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
Bootstrapping a self-hosted research virtual machine for JavaScript: an experience report 为JavaScript引导一个自托管的研究虚拟机:一份体验报告
Pub Date : 2011-10-24 DOI: 10.1145/2047849.2047858
Maxime Chevalier-Boisvert, Erick Lavoie, M. Feeley, Bruno Dufour
JavaScript is one of the most widely used dynamic languages. The performance of existing JavaScript VMs, however, is lower than that of VMs for static languages. There is a need for a research VM to easily explore new implementation approaches. This paper presents the Tachyon JavaScript VM which was designed to be flexible and to allow experimenting with new approaches for the execution of JavaScript. The Tachyon VM is itself implemented in JavaScript and currently supports a subset of the full language that is sufficient to bootstrap itself. The paper discusses the architecture of the system and in particular the bootstrapping of a self-hosted VM. Preliminary performance results indicate that our VM, with few optimizations, can already execute code faster than a commercial JavaScript interpreter on some benchmarks.
JavaScript是使用最广泛的动态语言之一。现有JavaScript虚拟机的性能低于静态语言虚拟机。需要一个研究型虚拟机来方便地探索新的实现方法。本文介绍了Tachyon JavaScript VM,它的设计是灵活的,并允许尝试新的JavaScript执行方法。Tachyon虚拟机本身是用JavaScript实现的,目前支持完整语言的一个子集,足以引导自己。本文讨论了系统的体系结构,特别是自托管虚拟机的自引导。初步性能结果表明,在一些基准测试中,我们的VM经过少量优化后,执行代码的速度已经超过了商业JavaScript解释器。
{"title":"Bootstrapping a self-hosted research virtual machine for JavaScript: an experience report","authors":"Maxime Chevalier-Boisvert, Erick Lavoie, M. Feeley, Bruno Dufour","doi":"10.1145/2047849.2047858","DOIUrl":"https://doi.org/10.1145/2047849.2047858","url":null,"abstract":"JavaScript is one of the most widely used dynamic languages. The performance of existing JavaScript VMs, however, is lower than that of VMs for static languages. There is a need for a research VM to easily explore new implementation approaches. This paper presents the Tachyon JavaScript VM which was designed to be flexible and to allow experimenting with new approaches for the execution of JavaScript. The Tachyon VM is itself implemented in JavaScript and currently supports a subset of the full language that is sufficient to bootstrap itself. The paper discusses the architecture of the system and in particular the bootstrapping of a self-hosted VM. Preliminary performance results indicate that our VM, with few optimizations, can already execute code faster than a commercial JavaScript interpreter on some benchmarks.","PeriodicalId":344101,"journal":{"name":"Dynamic Languages Symposium","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-10-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126795597","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
期刊
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