Abstract
This article defines AspectML, a typed functional, aspect-oriented programming language. The main contribution of AspectML is the seamless integration of polymorphism, run-time type analysis and aspect-oriented programming language features. In particular, AspectML allows programmers to define type-safe polymorphic advice using pointcuts constructed from a collection of polymorphic join points. AspectML also comes equipped with a type inference algorithm that conservatively extends Hindley--Milner type inference. To support first-class polymorphic point-cut designators, a crucial feature for developing aspect-oriented profiling or logging libraries, the algorithm blends the conventional Hindley--Milner type inference algorithm with a simple form of local type inference.
We give our language operational meaning via a type-directed translation into an expressive type-safe intermediate language. Many complexities of the source language are eliminated in this translation, leading to a modular specification of its semantics. One of the novelties of the intermediate language is the definition of polymorphic labels for marking control-flow points. When a set of labels is assembled as a pointcut, the type of each label is an instance of the type of the pointcut.
- Abadi, M. and Fournet, C. 2003. Access control based on execution history. In Proceedings of the 10th Symposium on Network and Distributed System Security (San Diego, CA). Internet Society, Reston, VA, 107--121.Google Scholar
- Aho, A. V., Sethi, R., and Ullman, J. D. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley, Boston, MA. Google ScholarDigital Library
- Aldrich, J. 2005. Open modules: Modular reasoning about advice. In Proceedings of the 19th European Conference on Object-Oriented Programming (Glasgow, UK). 144--168. Google ScholarDigital Library
- Avgustinov, P., Hajiyev, E., Ongkingco, N., de Moor, O., Sereni, D., Tibble, J., and Verbaere, M. 2007. Semantics of static pointcuts in AspectJ. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Nice, France). ACM, New York, 11--23. Google ScholarDigital Library
- Barendregt, H. 1985. The Lambda Calculus: Its Syntax and Semantics. Number 103 in Studies in Logic. North Holland.Google Scholar
- Bauer, L., Ligatti, J., and Walker, D. 2005. Composing security policies in polymer. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (Chicago, IL). ACM, New York, 305--314. Google ScholarDigital Library
- Bruns, G., Jagadeesan, R., Jeffrey, A., and Riely, J. 2004. muABC: A minimal aspect calculus. In Proceedings of the 15th International Conference on Concurrency Theory (London, UK), P. Gardner and N. Yoshida, Eds. Lecture Notes in Computer Science, vol. 3170. Springer, Berlin, Germany, 209--224.Google Scholar
- Clifton, C. and Leavens, G. T. 2002. Observers and assistants: A proposal for modular aspect-oriented reasoning. In Proceedings of the 2002 Workshop on Foundations of Aspect-Oriented Languages (Enschede, The Netherlands). 33--44.Google Scholar
- Colcombet, T. and Fradet, P. 2000. Enforcing trace properties by program transformation. In Proceedings of the 27th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Boston, MA). ACM, New York, 54--66. Google ScholarDigital Library
- Colyer, A. and Clement, A. 2004. Large-scale AOSD for middleware. In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development. ACM, New York, 56--65. Google ScholarDigital Library
- Damas, L. and Milner, R. 1982. Principal type schemes for functional programs. In Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Albuquerque, NM). ACM, New York, 207--212. Google ScholarDigital Library
- Dantas, D. S. and Walker, D. 2003. Aspects, information hiding and modularity. Tech. Rep. TR-696-04, Princeton University. Nov.Google Scholar
- Dantas, D. S. and Walker, D. 2006. Harmless advice. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 383--396. Google ScholarDigital Library
- Dantas, D. S., Walker, D., Washburn, G., and Weirich, S. 2005a. PolyAML: A polymorphic aspect-oriented functional programming language. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming (Tallinn, Estonia). ACM, New York, 306--319. Google ScholarDigital Library
- Dantas, D. S., Walker, D., Washburn, G., and Weirich, S. 2005b. PolyAML: A polymorphic aspect-oriented functional programmming language (extended version). Tech. Rep. MS-CIS-05-07, University of Pennsylvania. May.Google Scholar
- Douence, R., Fradet, P., and Südholt, M. 2004. Composition, reuse and interaction analysis of stateful aspects. In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (Lancaster, UK). ACM, New York, 141--150. Google ScholarDigital Library
- Douence, R., Motelet, O., and Südholt, M. 2001. A formal definition of crosscuts. In Proceedings of 3rd International Conference on Metalevel Architectures and Separation of Crosscutting Concerns (Kyoto, Japan), A. Yonezawa and S. Matsuoka, Eds. Lecture Notes in Computer Science, vol. 2192. Springer-Verlag, Berlin, Germany, 170--186. Google ScholarDigital Library
- Erlingsson, Ú. and Schneider, F. B. 1999. SASI enforcement of security policies: A retrospective. In Proceedings of the Workshop on New Security Paradigms (Caledon Hills, Canada). ACM, New York, 87--95. Google ScholarDigital Library
- Erlingsson, Ü. and Schneider, F. B. 2000. IRM enforcement of Java stack inspection. In Proceedings of the 2000 IEEE Symposium on Security and Privacy (Oakland, CA). IEEE Computer Society, Washington, DC, 246--255. Google ScholarDigital Library
- Evans, D. and Twyman, A. 1999. Flexible policy-directed code safety. In Proceedings of the 1999 IEEE Symposium on Security and Privacy (Oakland, CA). IEEE Computer Society, Washington, DC, 32--45.Google Scholar
- Filman, R. E. and Friedman, D. P. 2005. Aspect-Oriented Software Development. Addison-Wesley, Boston, MA, Chapter Aspect-Oriented Programming is Quantification and Obliviousness, 21--35.Google Scholar
- Fiuczynski, M., Cody, Y., Grimm, R., and Walker, D. 2005. Patch(1) considered harmful. In Proceedings of the 10th Workshop on Hot Topics in Operating Systems (Santa Fe, NM). USENIX, 91--96. Google ScholarDigital Library
- Gordon, A. and Fournet, C. 2003. Stack inspection: theory and variants. ACM Trans. Prog. Lang. Syst. 25, 3 (May), 360--399. Google ScholarDigital Library
- Harper, R. and Stone, C. 1998. A type-theoretic interpretation of Standard ML. In Proof, Language and Interaction: Essays in Honour of Robin Milner. The MIT Press, Cambridge, MA. Google ScholarDigital Library
- Harper, R. W. 2005. Programming Languages: Theory and Practice. In preparation, a draft can be obtained from http://www.cs.cmu.edu/_rwh/plbook/.Google Scholar
- Hinze, R., Löh, A., and Oliveira, B. C. 2006. “Scrap your boilerplate” reloaded. In Proceedings of the 8th International Symposium on Functional and Logic Programming (Fuji Susono, Japan), P. Waldler and M. Hagiya, Eds. 24--26. Google ScholarDigital Library
- Jagadeesan, R., Jeffrey, A., and Riely, J. 2003. A calculus of untyped aspect-oriented programs. In Proceedings of the 17th European Conference on Object-Oriented Programming (Darmstadt, Germany). Springer-Verlag, Berlin, Germany, 415--427.Google Scholar
- Jagadeesan, R., Jeffrey, A., and Riely, J. 2006. Typed parametric polymorphism for aspects. Sci. Comput. Prog. 63, 3, 267--296. Google ScholarDigital Library
- Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., and Griswold, W. 2001. An overview of AspectJ. In Proceedings of the 15th European Conference on Object-Oriented Programming (Budapest, Hungary). Springer-Verlag, 327--353. Google ScholarDigital Library
- Kim, M., Viswanathan, M., Ben-Abdallah, H., Kannan, S., Lee, I., and Sokolsky, O. 1999. Formally specified monitoring of temporal properties. In Proceedings of the 11th Euromicro Conference on Real-Time Systems (York, UK). 114--121.Google Scholar
- Lufer, K. and Odersky, M. 1992. An extension of ML with first-class abstract types. In Proceedings of the SIGPLAN Workshop on ML and its Applications (San Fransisco, California). 78--91.Google Scholar
- Lee, D. K., Crary, K., and Harper, R. 2007. Towards a mechanized metatheory of Standard ML. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Nice, France). ACM, New York, 173--184. Google ScholarDigital Library
- Lee, I., Kannan, S., Kim, M., Sokolsky, O., and Viswanathan, M. 1999. Run-time assurance based on formal specifications. In Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications (Las Vegas, NV).Google Scholar
- Lieberherr, K. J., Lorenz, D., and Ovlinger, J. 2003. Aspectual collaborations—combining modules and aspects. The Computer Journal 46, 5 (Sept.), 542--565.Google ScholarCross Ref
- Masuhara, H., Kiczales, G., and Dutchyn, C. 2002. Compilation semantics of aspect-oriented programs. In Proceedings of the Workshop on Foundations of Aspect-Oriented Languages (Lancaster, UK), G. T. Leavens and R. Cytron, Eds. 17--25.Google Scholar
- Masuhara, H., Tatsuzawa, H., and Yonezawa, A. 2005. Aspectual caml: an aspect-oriented functional language. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming (Tallinn, Estonia). ACM, New York, 320--330. Google ScholarDigital Library
- Matthews, D. 2005. Poly/ML. http://www.polyml.org/.Google Scholar
- Milner, R. 1978. A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17, 3, 348--375.Google ScholarCross Ref
- Milner, R., Tofte, M., Harper, R., and MacQueen, D. 1997. The Definition of Standard ML (Revised). MIT Press, Cambridge, MA. Google ScholarDigital Library
- Peyton Jones, S., Vytiniotis, D., Weirich, S., and Washburn, G. 2006. Simple unification-based type inference for GADTs. In Proceedings of the 11th ACM SIGPLAN International Conference on Functional Programming (Portland, OR). ACM, New York, 50--61. Google ScholarDigital Library
- Peyton Jones, S. L., Vytiniotis, D., Weirich, S., and Shields, M. 2007. Practical type inference for arbitrary-rank types. J. Funct. Program 17, 1 (Jan.), 1--82. Google ScholarDigital Library
- Pierce, B. C. and Turner, D. N. 1998. Local type inference. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Diego, CA). ACM, New York, 252--265. Google ScholarDigital Library
- Plotkin, G. D. 1970. A note on inductive generalization. In Machine Intelligence. Vol. 5. Edinburgh University Press, 153--163.Google Scholar
- Plotkin, G. D. 1971. A further note on inductive generalization. In Machine Intelligence. Vol. 6. Edinburgh University Press, 101--124.Google Scholar
- Pottier, F. and Rgis-Gianas, Y. 2006. Stratified type inference for generalized algebraic data types. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Charleston, SC). ACM, New York, 232--244. Google ScholarDigital Library
- Schneider, F. B. 2000. Enforceable security policies. ACM Transactions on Information and Systems Security 3, 1 (Feb.), 30--50. Google ScholarDigital Library
- Sheard, T. 2005. Putting Curry-Howard to work. In Proceedings of the 2005 ACM SIGPLAN Workshop on Haskell (Tallinn, Estonia). ACM, 74--85. Google ScholarDigital Library
- Shields, M. and Peyton Jones, S. 2002. Lexically scoped type variables. Microsoft Research. Available at http://research.microsoft.com/Users/simonpj/papers/scoped-tyvars.Google Scholar
- Simonet, V. and Pottier, F. 2005. Constraint-based type inference for guarded algebraic data types. Tech. Rep. Research Report 5462, INRIA. Jan.Google Scholar
- Sullivan, K., Griswold, W. G., Song, Y., Cai, Y., Shonle, M., Tewari, N., and Rajan, H. 2005. Information hiding interfaces for aspect-oriented design. In Proceedings of the 10th Conference on European Software Engineering held jointly with the 13th ACM SIGSOFT International Symposium on the Foundations of Software Engineering (Lisbon, Portugal). ACM, New York, 166--175. Google ScholarDigital Library
- Sulzmann, M., Schrijvers, T., and Stuckey, P. J. 2006. Type inference for GADTS via herbrand constraint abduction. http//www.comp.nus.edu.sg/~sulzmann/manuscript/gadtshort.ps.Google Scholar
- Tucker, D. B. and Krishnamurthi, S. 2003. Pointcuts and advice in higher-order languages. In Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (Boston, MA). ACM, New York, 158--167. Google ScholarDigital Library
- Vytiniotis, D., Weirich, S., and Peyton Jones, S. 2006. Boxy types: inference for higher-rank types and impredicativity. In Proceedings of the 11th ACM SIGPLAN International Conference on Functional Programming (Portland, OR). ACM, New York, 251--262. Google ScholarDigital Library
- Walker, D., Zdancewic, S., and Ligatti, J. 2003. A theory of aspects. In Proceedings of the 8th ACM SIGPLAN International Conference on Functional Programming (Uppsala, Sweden). ACM, New York, 127--139. Google ScholarDigital Library
- Wand, M., Kiczales, G., and Dutchyn, C. 2003. A semantics for advice and dynamic join points in aspect-oriented programming. ACM Trans. Prog. Lang. Syst. 26, 5, 890--910. Google ScholarDigital Library
- Wang, M., Chen, K., and Khoo, S.-C. 2006. On the pursuit of staticness and coherence. In Proceedings of the 5th Workshop on Foundations of Aspect-Oriented Languages (Bonn, Germany).Google Scholar
- Washburn, G., and Weirich, S. 2005. Generalizing parametricity using information flow. In Proceedings of the 20th IEEE Symposium on Logic in Computer Science (Chicago, IL, USA). IEEE Computer Society Press, Los Alamitos, CA, 62--71. Google ScholarDigital Library
Index Terms
- AspectML: A polymorphic aspect-oriented functional programming language
Recommendations
PolyAML: a polymorphic aspect-oriented functional programming language
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingThis paper defines PolyAML, a typed functional, aspect-oriented programming language. The main contribution of Poly<SMALL>AML</SMALL> is the seamless integration of polymorphism, run-time type analysis and aspect-oriented programming language features. ...
PolyAML: a polymorphic aspect-oriented functional programming language
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingThis paper defines PolyAML, a typed functional, aspect-oriented programming language. The main contribution of Poly<SMALL>AML</SMALL> is the seamless integration of polymorphism, run-time type analysis and aspect-oriented programming language features. ...
A polymorphic modal type system for lisp-like multi-staged languages
POPL '06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesThis article presents a polymorphic modal type system and its principal type inference algorithm that conservatively extend ML by all of Lisp's staging constructs (the quasi-quotation system). The combination is meaningful because ML is a practical ...
Comments