以型態推演技術製作AspectFun語言編譯器

AspectFun是一個實驗性的剖面導向函式語言,它主要的特色在於具備能以靜態織入方式實現的多型剖面、高階剖面以及依據動態流程觸發的剖面。 本論文提出一個AspectFun語言的編譯器,其編譯過程分為四個主要步驟:語法結構轉換、剖面織入、剖面轉函式與整合動態流程判斷資訊。其中剖面織入是最複雜的步驟,必須仰賴可能是多型的型態資訊,選取適當的剖面整合到程式指定的切點處。這部份的織入工作,我們的編譯器是依據一套以靜態型態推論規則發展而來的轉譯規則,先將AspectFun程式轉譯成的剖面與函式整合在一起的中介格式,再翻譯為可執行的Haskell程式來完成。此外,本系統也是使用Haskell程式語言開發...

Full description

Bibliographic Details
Main Authors: 陳忠信, Chen, Chung Hsin
Language:中文
Published: 國立政治大學
Subjects:
Online Access:http://thesis.lib.nccu.edu.tw/cgi-bin/cdrfb3/gsweb.cgi?o=dstdcdr&i=sid=%22G0094753003%22.
id ndltd-CHENGCHI-G0094753003
record_format oai_dc
spelling ndltd-CHENGCHI-G00947530032013-01-07T19:31:33Z 以型態推演技術製作AspectFun語言編譯器 Implementing a Type-Directed Translator for AspectFun 陳忠信 Chen, Chung Hsin 型態系統 型態推論 剖面導向程式設計 Type system Type inference Aspect-oriented programming AspectFun是一個實驗性的剖面導向函式語言,它主要的特色在於具備能以靜態織入方式實現的多型剖面、高階剖面以及依據動態流程觸發的剖面。 本論文提出一個AspectFun語言的編譯器,其編譯過程分為四個主要步驟:語法結構轉換、剖面織入、剖面轉函式與整合動態流程判斷資訊。其中剖面織入是最複雜的步驟,必須仰賴可能是多型的型態資訊,選取適當的剖面整合到程式指定的切點處。這部份的織入工作,我們的編譯器是依據一套以靜態型態推論規則發展而來的轉譯規則,先將AspectFun程式轉譯成的剖面與函式整合在一起的中介格式,再翻譯為可執行的Haskell程式來完成。此外,本系統也是使用Haskell程式語言開發,並採用Monad技術將系統模組化,以達到最佳的可維護性、擴充性與閱讀性。本論文介紹系統的實作面,解釋AspectFun系統架構、語法、原理和實作帶來的貢獻以及限制。 AspectFun is an experimental aspect-oriented functional language. Its main features include polymorphic aspects via static weaving, second-order aspects and control-flow triggered aspects. This thesis presents a type-directed compiler for AspectFun. Our compilation processes consists of four major steps: syntax de-sugaring, aspect weaving, translating aspects to normal functions, and integrating control flow information. The most complicated one is aspect weaving. Due to polymorphism in aspects, it is completely dependent on type information inferable from the aspects and the context they are used. We base our weaving step on a set of type-directed translation rules. In particular, the weaving step is further divided into two stages. First, an AspectFun program is translated into an intermediate form in which all aspects applicable at a context are chained together and integrated with context. Second, all aspects are translated into ordinary functions and any chain of aspects are transformed to a sequence of function calls in as an executable Haskell program. Moreover, the complier itself is implemented in Haskell. We fully utilize the monad mechanism of Haskell to modularize our compiler and achieve the goals of good maintainability, extensibility and readability. 國立政治大學 http://thesis.lib.nccu.edu.tw/cgi-bin/cdrfb3/gsweb.cgi?o=dstdcdr&i=sid=%22G0094753003%22. text 中文 Copyright © nccu library on behalf of the copyright holders
collection NDLTD
language 中文
sources NDLTD
topic 型態系統
型態推論
剖面導向程式設計
Type system
Type inference
Aspect-oriented programming
spellingShingle 型態系統
型態推論
剖面導向程式設計
Type system
Type inference
Aspect-oriented programming
陳忠信
Chen, Chung Hsin
以型態推演技術製作AspectFun語言編譯器
description AspectFun是一個實驗性的剖面導向函式語言,它主要的特色在於具備能以靜態織入方式實現的多型剖面、高階剖面以及依據動態流程觸發的剖面。 本論文提出一個AspectFun語言的編譯器,其編譯過程分為四個主要步驟:語法結構轉換、剖面織入、剖面轉函式與整合動態流程判斷資訊。其中剖面織入是最複雜的步驟,必須仰賴可能是多型的型態資訊,選取適當的剖面整合到程式指定的切點處。這部份的織入工作,我們的編譯器是依據一套以靜態型態推論規則發展而來的轉譯規則,先將AspectFun程式轉譯成的剖面與函式整合在一起的中介格式,再翻譯為可執行的Haskell程式來完成。此外,本系統也是使用Haskell程式語言開發,並採用Monad技術將系統模組化,以達到最佳的可維護性、擴充性與閱讀性。本論文介紹系統的實作面,解釋AspectFun系統架構、語法、原理和實作帶來的貢獻以及限制。 === AspectFun is an experimental aspect-oriented functional language. Its main features include polymorphic aspects via static weaving, second-order aspects and control-flow triggered aspects. This thesis presents a type-directed compiler for AspectFun. Our compilation processes consists of four major steps: syntax de-sugaring, aspect weaving, translating aspects to normal functions, and integrating control flow information. The most complicated one is aspect weaving. Due to polymorphism in aspects, it is completely dependent on type information inferable from the aspects and the context they are used. We base our weaving step on a set of type-directed translation rules. In particular, the weaving step is further divided into two stages. First, an AspectFun program is translated into an intermediate form in which all aspects applicable at a context are chained together and integrated with context. Second, all aspects are translated into ordinary functions and any chain of aspects are transformed to a sequence of function calls in as an executable Haskell program. Moreover, the complier itself is implemented in Haskell. We fully utilize the monad mechanism of Haskell to modularize our compiler and achieve the goals of good maintainability, extensibility and readability.
author 陳忠信
Chen, Chung Hsin
author_facet 陳忠信
Chen, Chung Hsin
author_sort 陳忠信
title 以型態推演技術製作AspectFun語言編譯器
title_short 以型態推演技術製作AspectFun語言編譯器
title_full 以型態推演技術製作AspectFun語言編譯器
title_fullStr 以型態推演技術製作AspectFun語言編譯器
title_full_unstemmed 以型態推演技術製作AspectFun語言編譯器
title_sort 以型態推演技術製作aspectfun語言編譯器
publisher 國立政治大學
url http://thesis.lib.nccu.edu.tw/cgi-bin/cdrfb3/gsweb.cgi?o=dstdcdr&i=sid=%22G0094753003%22.
work_keys_str_mv AT chénzhōngxìn yǐxíngtàituīyǎnjìshùzhìzuòaspectfunyǔyánbiānyìqì
AT chenchunghsin yǐxíngtàituīyǎnjìshùzhìzuòaspectfunyǔyánbiānyìqì
AT chénzhōngxìn implementingatypedirectedtranslatorforaspectfun
AT chenchunghsin implementingatypedirectedtranslatorforaspectfun
_version_ 1716464789198209024