學術產出-Theses

Article View/Open

Publication Export

Google ScholarTM

政大圖書館

Citation Infomation

  • No doi shows Citation Infomation
題名 以AspectFun探討模組化型態擴充與泛型程式設計
A study on modular type extension and generic programming using AspectFun
作者 陳政宏
Chen, Cheng Hung
貢獻者 陳恭
Chen, Kung
陳政宏
Chen, Cheng Hung
關鍵詞 函數式剖面導向語言
泛型程式設計
AspectFun
generic programming
expression problem
type class
日期 2009
上傳時間 9-Apr-2010 13:33:32 (UTC+8)
摘要 AspectFun是一個語法近似Haskell語言的函數式剖面導向語言。本論文中探討AspectFun在模組化型態擴充以及泛型程式設計上可扮演的角色。研究首先比較剖面與Haskell語言的type class在處理型態擴充需求議題的可行性,型態擴充議題我們以著名的Expression Problem作為代表(程式語言機制如何確保程式在擴充資料與運算函數的過程中,不需要修改舊有的程式碼,並能確保程式的型態安全)。
我們接著會探討剖面如何以模組化方式實現泛型程式設計。泛型程式設計是指函數接收一額外的型態引數,且函數所執行的運算是依據此型態引數結構來進行的。型態引數是用來表示函數所處理的引數或其回傳值型態為何,但型態引數在函數定義中可能是明確定義的或者隱含的。在此研究中會展示以剖面實現的泛型程式設計更優於使用type class。此外,本研究為使AspectFun可以實現泛型程式設計方法,亦在AspectFun擴充了Existential types與多型互遞迴函數。
AspectFun is an aspect-oriented functional language with a Haskell-like syntax.
This thesis present an study on modular type extension and generic programming using AspectFun. First, we compare the feasibility of using aspects and Haskell`s type classes to address the type extension requirements as stated in the famous expression problem (which calls for language mechanisms that can support type-safe program extension in both the dimensions of data types and associated operations, yet neither code duplication nor code rewriting is required.)
Second, we investigate how to use aspects to support generic programming in amodular manner. Generic programming means a form of programming in which a function takes a type as argument, and its behavior depends upon the structure of this type. The type argument, which may be explicit or implicit, represents the type of values to which the function is applied, or which the function returns. We show that aspects can do better than type classes in supporting generic programming. In particular, we extend AspectFun with existential types and polymorphic mutual recursion to achieve such a result.
參考文獻 [1] G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. "Aspect-oriented programming." ECOOP `97 Object-Oriented Programming 11th European Conference, Finland (M. Aksit and S. Matsuoka, eds.). 1997, vol. 1241, pp. 220-242, New York, NY: Springer-Verlag.
[2] D. S. Dantas, D. Walker, G. Washburn, and S. Weirich, "PolyAML: a polymorphic aspect-oriented functional programming language." Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, 2005, pp. 306 – 319.
[3] H. Masuhara, H. Tatsuzawa, and A. Yonezawa, "Aspectual Caml: an aspect-oriented functional language." Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, 2005, pp. 320 - 330.
[4] K. Chen, S. C. Weng, M. Wang, S.C. Khoo, and C.H. Chen, "A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages." Symposium of Static Analysis (SAS), 2007.
[5] Mads Torgersen. “The Expression Problem Revisited – Four new solutions using generics.” ECOOP’04.
[6] Jens Palsberg, C. Barry Jay “The essence of the visitor pattern” Computer Software and applications conference 1998. COMPSAC apos;98. proceedings. Aug 1998, The twenty second annual International. Volume, issue, 19-21, pp. 9 – 15.
[7] Koji Kagawa, “Polymorphic variants in Haskell”, Proceedings of the 2006 ACM SIGPLAN workshop on Haskell.
[8] Martin Odersky, Zenger, “Scalable Component Abstractions.”, Proceedings of OOPSLA 2005.
[9] Matthias Zenger, Martin Odersky. “Independently Extensible Solutions to the Expression Problem.”, EPFL I&C technical report, March 2005, NO. 2005013
[10] Konstatin Laufer ,“What Functional Programmers can Learn from the Visitor Pattern.” ICFP March 2003
[11] Ralf Hinze, Andres Loh, “Generic programming in 3D.”, science of computer programming, June 2009, Volume 74, Issue 8
[12] Jan de Wit. “A technical overview of Generic Haskell.” Master`s thesis, department of Information and Computing Sciences, Utrecht University, 2002, INF-SCR-02-03,
[13] Gilad Bracha, William Cook. “Mixin-based inheritance.”, Conference on Object Oriented Programming Systems Languages and Applications. Proceedings of the European conference on object-oriented programming on Object-oriented programming systems ,languages, and applications, 1990, Page : 303 – 311.
[14] Andres Loh, Ralf Hinze, ”Open data types and open functions”, Proceedings of the 8th ACM SIGPLAN international conference on principle and practice of declarative programming page, 2006, pp.133-144.
[15] James Cheney, Ralf Hinze, “A lightweight implementation of generics and dynamics.”, Proceeding of the 2002 ACM SIGPLAN workshop on Haskell
[16] Geoffrey Washburn, Setphanie Weirich, “Good advice for type directed programming aspect-oriented programming and extensible generic programming.”, proceedings of the 2006 ACM SIGPLAN workshop on generic programming.
描述 碩士
國立政治大學
資訊科學學系
96753035
98
資料來源 http://thesis.lib.nccu.edu.tw/record/#G0096753035
資料類型 thesis
dc.contributor.advisor 陳恭zh_TW
dc.contributor.advisor Chen, Kungen_US
dc.contributor.author (Authors) 陳政宏zh_TW
dc.contributor.author (Authors) Chen, Cheng Hungen_US
dc.creator (作者) 陳政宏zh_TW
dc.creator (作者) Chen, Cheng Hungen_US
dc.date (日期) 2009en_US
dc.date.accessioned 9-Apr-2010 13:33:32 (UTC+8)-
dc.date.available 9-Apr-2010 13:33:32 (UTC+8)-
dc.date.issued (上傳時間) 9-Apr-2010 13:33:32 (UTC+8)-
dc.identifier (Other Identifiers) G0096753035en_US
dc.identifier.uri (URI) http://nccur.lib.nccu.edu.tw/handle/140.119/38549-
dc.description (描述) 碩士zh_TW
dc.description (描述) 國立政治大學zh_TW
dc.description (描述) 資訊科學學系zh_TW
dc.description (描述) 96753035zh_TW
dc.description (描述) 98zh_TW
dc.description.abstract (摘要) AspectFun是一個語法近似Haskell語言的函數式剖面導向語言。本論文中探討AspectFun在模組化型態擴充以及泛型程式設計上可扮演的角色。研究首先比較剖面與Haskell語言的type class在處理型態擴充需求議題的可行性,型態擴充議題我們以著名的Expression Problem作為代表(程式語言機制如何確保程式在擴充資料與運算函數的過程中,不需要修改舊有的程式碼,並能確保程式的型態安全)。
我們接著會探討剖面如何以模組化方式實現泛型程式設計。泛型程式設計是指函數接收一額外的型態引數,且函數所執行的運算是依據此型態引數結構來進行的。型態引數是用來表示函數所處理的引數或其回傳值型態為何,但型態引數在函數定義中可能是明確定義的或者隱含的。在此研究中會展示以剖面實現的泛型程式設計更優於使用type class。此外,本研究為使AspectFun可以實現泛型程式設計方法,亦在AspectFun擴充了Existential types與多型互遞迴函數。
zh_TW
dc.description.abstract (摘要) AspectFun is an aspect-oriented functional language with a Haskell-like syntax.
This thesis present an study on modular type extension and generic programming using AspectFun. First, we compare the feasibility of using aspects and Haskell`s type classes to address the type extension requirements as stated in the famous expression problem (which calls for language mechanisms that can support type-safe program extension in both the dimensions of data types and associated operations, yet neither code duplication nor code rewriting is required.)
Second, we investigate how to use aspects to support generic programming in amodular manner. Generic programming means a form of programming in which a function takes a type as argument, and its behavior depends upon the structure of this type. The type argument, which may be explicit or implicit, represents the type of values to which the function is applied, or which the function returns. We show that aspects can do better than type classes in supporting generic programming. In particular, we extend AspectFun with existential types and polymorphic mutual recursion to achieve such a result.
en_US
dc.description.tableofcontents 第一章 導論 1
1.1 研究動機 1
1.2 研究目標 2
1.3 論文之成果 3
1.4 論文之限制 3
1.5 論文章節架構 3
第二章 背景介紹 5
2.1 程式的可重用性 (reusability)及擴展性(extensibility) 5
2.2 AspectFun介紹 5
2.2.1 AspectFun語言特色與基礎語法介紹 6
2.2.2 Type-scoped advice 7
2.2.3 Cflow pointcut 8
2.2.4 data+ 8
2.2.5 AspectFun的織入系統介紹 9
第三章 探討AspectFun的程式重用性與擴充性 12
3.1 The Expression Problem 12
3.2 Open datatype / Open function 13
3.3 AspectFun的程式擴充機制在Expression Problem的應用 15
3.4 相關程式重用與擴充議題探討 16
第四章 以AspectFun輔助實現泛型程式設計 19
4.1泛型程式設計 19
4.1.1 重載函數(overloaded function) 19
4.1.2 泛型程式設計與相關研究介紹 20
4.2 實現泛型程式設計所面臨的問題 23
4.2.1以type classes機制輔助實現泛型程式設計的實作與問題 23
4.3以AspectFun輔助實現的泛型程式設計 26
4.4相關的函數式剖面語言研究探討 30
4.5 AspectFun修改細節 30
4.5.1 Existential types 30
4.5.2 Predicate propagation 32
4.5.3 Polymorphic mutual recursion 34
第五章 結論與未來研究 36
參考文獻 37
附錄 39
附錄一 39
附錄二 41
附錄三 42
zh_TW
dc.format.extent 876271 bytes-
dc.format.mimetype application/pdf-
dc.language.iso en_US-
dc.source.uri (資料來源) http://thesis.lib.nccu.edu.tw/record/#G0096753035en_US
dc.subject (關鍵詞) 函數式剖面導向語言zh_TW
dc.subject (關鍵詞) 泛型程式設計zh_TW
dc.subject (關鍵詞) AspectFunen_US
dc.subject (關鍵詞) generic programmingen_US
dc.subject (關鍵詞) expression problemen_US
dc.subject (關鍵詞) type classen_US
dc.title (題名) 以AspectFun探討模組化型態擴充與泛型程式設計zh_TW
dc.title (題名) A study on modular type extension and generic programming using AspectFunen_US
dc.type (資料類型) thesisen
dc.relation.reference (參考文獻) [1] G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. "Aspect-oriented programming." ECOOP `97 Object-Oriented Programming 11th European Conference, Finland (M. Aksit and S. Matsuoka, eds.). 1997, vol. 1241, pp. 220-242, New York, NY: Springer-Verlag.zh_TW
dc.relation.reference (參考文獻) [2] D. S. Dantas, D. Walker, G. Washburn, and S. Weirich, "PolyAML: a polymorphic aspect-oriented functional programming language." Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, 2005, pp. 306 – 319.zh_TW
dc.relation.reference (參考文獻) [3] H. Masuhara, H. Tatsuzawa, and A. Yonezawa, "Aspectual Caml: an aspect-oriented functional language." Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, 2005, pp. 320 - 330.zh_TW
dc.relation.reference (參考文獻) [4] K. Chen, S. C. Weng, M. Wang, S.C. Khoo, and C.H. Chen, "A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages." Symposium of Static Analysis (SAS), 2007.zh_TW
dc.relation.reference (參考文獻) [5] Mads Torgersen. “The Expression Problem Revisited – Four new solutions using generics.” ECOOP’04.zh_TW
dc.relation.reference (參考文獻) [6] Jens Palsberg, C. Barry Jay “The essence of the visitor pattern” Computer Software and applications conference 1998. COMPSAC apos;98. proceedings. Aug 1998, The twenty second annual International. Volume, issue, 19-21, pp. 9 – 15.zh_TW
dc.relation.reference (參考文獻) [7] Koji Kagawa, “Polymorphic variants in Haskell”, Proceedings of the 2006 ACM SIGPLAN workshop on Haskell.zh_TW
dc.relation.reference (參考文獻) [8] Martin Odersky, Zenger, “Scalable Component Abstractions.”, Proceedings of OOPSLA 2005.zh_TW
dc.relation.reference (參考文獻) [9] Matthias Zenger, Martin Odersky. “Independently Extensible Solutions to the Expression Problem.”, EPFL I&C technical report, March 2005, NO. 2005013zh_TW
dc.relation.reference (參考文獻) [10] Konstatin Laufer ,“What Functional Programmers can Learn from the Visitor Pattern.” ICFP March 2003zh_TW
dc.relation.reference (參考文獻) [11] Ralf Hinze, Andres Loh, “Generic programming in 3D.”, science of computer programming, June 2009, Volume 74, Issue 8zh_TW
dc.relation.reference (參考文獻) [12] Jan de Wit. “A technical overview of Generic Haskell.” Master`s thesis, department of Information and Computing Sciences, Utrecht University, 2002, INF-SCR-02-03,zh_TW
dc.relation.reference (參考文獻) [13] Gilad Bracha, William Cook. “Mixin-based inheritance.”, Conference on Object Oriented Programming Systems Languages and Applications. Proceedings of the European conference on object-oriented programming on Object-oriented programming systems ,languages, and applications, 1990, Page : 303 – 311.zh_TW
dc.relation.reference (參考文獻) [14] Andres Loh, Ralf Hinze, ”Open data types and open functions”, Proceedings of the 8th ACM SIGPLAN international conference on principle and practice of declarative programming page, 2006, pp.133-144.zh_TW
dc.relation.reference (參考文獻) [15] James Cheney, Ralf Hinze, “A lightweight implementation of generics and dynamics.”, Proceeding of the 2002 ACM SIGPLAN workshop on Haskellzh_TW
dc.relation.reference (參考文獻) [16] Geoffrey Washburn, Setphanie Weirich, “Good advice for type directed programming aspect-oriented programming and extensible generic programming.”, proceedings of the 2006 ACM SIGPLAN workshop on generic programming.zh_TW