標題: 網頁瀏覽器上動態語言之混合式執行模型
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
顯示於類別:研究計畫