Type-directed weaving of aspects for polymorphically typed functional languages
نویسندگان
چکیده
Incorporating aspect-oriented paradigm to a polymorphically typed functional language enables the declaration of type-scoped advice, in which the effect of an aspect can be harnessed by introducing possibly polymorphic type constraints to the aspect. The amalgamation of aspect orientation and functional programming enables quick behavioral adaption of functions, clear separation of concerns and expressive type-directed programming. However, proper static weaving of aspects in polymorphic languages with a typeerasure semantics remains a challenge. In this paper, we describe a typedirected static weaving strategy, as well as its implementation, that supports static type inference and static weaving of programs written in an aspectoriented polymorphically typed functional language, AspectFun. We show examples of type-scoped advice, identify the challenges faced with compiletime weaving in the presence of type-scoped advice, and demonstrate how various advanced aspect features can be handled by our techniques. Lastly, we prove the correctness of the static weaving strategy with respect to the operational semantics of AspectFun.
منابع مشابه
A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages (Technical Report)
Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices; i.e., advices with their effects being harnessed by type constraints. As types are typically treated as compile time entities, it is desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices to the invocations of t...
متن کاملA Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages
Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices; i.e., advices with their effects harnessed by type constraints. As types are typically treated as compile time entities, it is highly desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices to their associated jo...
متن کاملA Typed Intermediate Language for Flow-Directed Compilation
We present a typed intermediate language λ for optimizing compilers for function-oriented and polymorphically typed programming languages (e.g., ML). The language λ is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed pr...
متن کاملOn the Pursuit of Static and Coherent Weaving
Aspect-oriented programming (AOP) has been shown to be a useful model for software development. Special care must be taken when we try to adapt AOP to strongly typed functional languages which come with features like type inference mechanism, polymorphic types, higher-order functions and type-scoped pointcuts. Specifically, it is highly desirable that weaving of aspect-oriented functional progr...
متن کاملMl-style Typing, Lambda Lifting, and Partial Evaluation
Lambda lifting transforms local function deenitions in functional programming languages into global ones to facilitate their eecient implementation. When considered as a source-to-source transformation for an ML-style typed language, all published algorithms for lambda lifting break typability. We break down two representative lambda lifting algorithms into four elementary transformation steps,...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Sci. Comput. Program.
دوره 75 شماره
صفحات -
تاریخ انتشار 2010