标题: 网页浏览器上动态语言之混合式执行模型
A Hybrid Execution Model for Dynamic Languages on Web Browsers
作者: 游逸平
You Yi-Ping
国立交通大学资讯工程学系(所)
关键字: 动态语言;型别推断;网页浏览器;LLVM IR;Native Client;dynamic languages;type inference;Web browsers;LLVM IR;Native Client
公开日期: 2015
摘要: 动态语言(dynamic language)的程式简洁、语法灵靈活、具有高度度弹性,使得其可以进行行更更快速的开
发。在近年年来來成为许多开发者的选择,尤其是在动态网页的程式开发上,如PHP、Python、JavaScript…
等。其中随着HTML5 的问世,其各类類API 皆基于JavaScript 进行行使用,更更是提升了了JavaScript 之重要
性。因为动态语言具有灵靈活的型别处理理、动态生成与程式弹性,使得动态语言部份之特性需要实际执
行行才能被决定,所以动态语言多半透过直译器(interpreter)来來执行行。但直译器的执行行速度度慢,虽然有许
多研究致力力于改善直译器的执行行效能,但其效能终究低于以静态编译(static compilation)方式的执行行效
能。因此本计画为动态语言提出一个混合式的执行行模型,也就是透过编译技术在静态时期进行行分析,
将动态语言中可被决定特性之部分提前进行行编译优化,保留留无法决定特性之部分保留留至执行行时由现存
之runtime 执行行,如此截取编译方式的高执行行效能,同时也保留留动态生成的弹性。我们将以LLVM 作
为编译架构,并提出一套无形别资讯之IR。本计画将以JavaScript 作为个案研究,将其进行行部分编译,
保留留无法编译之JavaScript,并透过现有机制使其可以在浏览器上执行行,以评估本计画提出之混合式执
行行模型的成效。
本子计画主持人在编译器设计的领領域有多年年的研究经验,特别是在编译器最佳化设计方面的研
究。我们认为这个研究除了了可以帮助我们在动态语言技术方面取得关键性突破外,也可在其相关技术
领領域中占得先机。我们将会积极地研究相关技术,学生和研究者将会获得非常高阶技术的实际经验。
Dynamic languages are compact, flexible, and easy to write, and even allow a property or a method to
be dynamically added to an object, so programmers could really focus on the design of their applications
without dealing with the problems that are relevant to data types, which shorten the development time.
Therefore, many programmers choose dynamic languages as their primary languages for developing
applications, especially in the web application developments. With the advent of HTML5, which provides
lots of APIs based on the JavaScript language, it is even more important to enhance the execution
performance of JavaScript applications. The features of dynamic languages, such as loose typing and
prototype-based object models, are usually implemented by running programs in dynamic languages on
interpreters. However, the execution performance of interpreters is poorly slow. Although there were some
research studies that focused on improving the execution of interpreters, a language implementation using
compilation usually out performs that using interpretation. In this project, we propose a hybrid execution
model for dynamic languages; that is, programs in dynamic languages may run in both of the compilation
and interpretation models so as to take advantages of high-performance execution in the compilation model
and dynamic code evaluation in the interpretation model. We will design and implement a typeless IR
system based on the LLVM infrastructure, and use the JavaScript language as a case study to evaluate the
proposed hybrid execution model for dynamic languages.
The PI of the project had research and development experiences in the field of optimizing compilers
for many years. We think that this research and development work can lead to the establishment of the key
technologies in the areas of dynamic languages. We will also actively research into optimization issues
related to dynamic languages. Students and researchers will learn real experiences with a very critical
software technology.
官方说明文件#: MOST103-2221-E009-103-MY3
URI: http://hdl.handle.net/11536/130515
https://www.grb.gov.tw/search/planDetail?id=11263218&docId=453095
显示于类别:Research Plans