ABSTRACT
By extending an ML-style type system with record polymorphism, recursive type definition, and an ordering relation induced by field inclusion, it is possible to achieve seamless and type safe interoperability with an object-oriented language. Based on this observation, we define a polymorphic language that can directly access external objects and methods, and develop a type inference algorithm. This calculus enjoys the features of both higher-order programming with ML polymorphism and class-based object-oriented programming with dynamic method dispatch. To establish type safety, we define a sample object-oriented language with multiple inheritance as the target for interoperability, define an operational semantics of the calculus, and show that the type system is sound with respect to the operational semantics. These results have been implemented in our prototype interpretable language, which can access Java class files and other external resources.
- M. Blume. No-longer-foreign: Teaching an ML compiler to speak C "natively". In N. Benton and A. Kennedy, editors, Electronic Notes in Theoretical Computer Science, volume~59. Elsevier Science Publishers, 2001.Google Scholar
- L. Cardelli. A semantics of multiple inheritance. In Semantics of Data Types, Lecture Notes in Computer Science 173. Springer-Verlag, 1984. Google ScholarDigital Library
- L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471--522, Dec. 1985. Google ScholarDigital Library
- M. Corporation and D. Corporation. The component object model specification, 1995.Google Scholar
- S. Finne, D. Leijen, E. Meijer, and S. L. P. Jones. Calling hell from heaven and heaven from hell. In International Conference on Functional Programming, pages 114--125, 1999. Google ScholarDigital Library
- S. Finne, D. Leijen, E. Meijer, and S. P. Jones. H/Direct: A binary foreign language interface for Haskell. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP '98), volume 34(1) of ACM SIGPLAN Notices, pages 153--162. ACM, June 1999. Google ScholarDigital Library
- K. Fisher and J. H. Reppy. The design of a class mechanism for Moby. In SIGPLAN Conference on Programming Language Design and Implementation (PDLI), pages 37--49, 1999. Google ScholarDigital Library
- Y.-C. Fuh and P. Mishra. Type inference with subtypes. In Proceedings of ESOP '88, pages 94--114, 1988. Springer LNCS 300. Google ScholarDigital Library
- C. Gunter and J. Mitchell, editors. Theoretical Aspects of Object-Oriented Programming. MIT Press, 1994. Google ScholarDigital Library
- C. V. Hall, K. Hammond, S. L. Peyton Jones, and P. L. Wadler. Type classes in Haskell. ACM Transactions on Programming Languages and Systems, 18(2):109--138, Mar. 1996. Google ScholarDigital Library
- X. Leroy. Polymorphic typing of an algorithmic language. PhD thesis, University of Paris VII, 1992.Google Scholar
- X. Leroy. The Objective Caml system: Documentation and user's manual, 2000. (with Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon Available from http://caml.inria.fr.)Google Scholar
- T. Lindholm and F. Yellin. The Java virtual machine specification. Addison Wesley, second edition edition, 1999. Google ScholarDigital Library
- E. Meijer and K. Claessen. The design and implementation of Mondrian. In Haskell Workshop. ACM, June 1997.Google Scholar
- E. Meijer and S. Finne. Lambada, Haskell as a better java. In G. Hutton, editor, Electronic Notes in Theoretical Computer Science, volume~41. Elsevier Science Publishers, 2001.Google Scholar
- J. Mitchell. Type inference and type containment. In Semantics of Data Types, Lecture Notes in Computer Science 173, pages 257--277. Springer-Verlag, 1984. Google ScholarDigital Library
- J. Nordlander. Pragmatic subtyping in polymorphic languages. In International Conference on Functional Programming (ICFP), 1998. Google ScholarDigital Library
- A. Ohori. A polymorphic record calculus and its compilation. ACM Transactions on Programming Languages and Systems, 17(6):844--895, 1995. A preliminary summary appeared at ACM POPL, 1992 under the title "A compilation method for ML-style polymorphic record calculi". Google ScholarDigital Library
- D. Remy. Typechecking records and variants in a natural extension of ML. In Proc. ACM Symposium on Principles of Programming Languages, pages 242--249, 1989. Google ScholarDigital Library
- D. Rémy and J. Vouillon. Objective ML: An effective object-oriented extension to ML. Theory And Practice of Object Systems, 4(1):27--50, 1998. Summary in Proc. ACM POPL Symposium, 1997. Google ScholarDigital Library
- R. Stansifer. Type inference with subtypes. In Proc. ACM Symposium on Principles of Programming Languages, pages 88--97, 1988. Google ScholarDigital Library
Index Terms
An interoperable calculus for external object access
Recommendations
An interoperable calculus for external object access
By extending an ML-style type system with record polymorphism, recursive type definition, and an ordering relation induced by field inclusion, it is possible to achieve seamless and type safe interoperability with an object-oriented language. Based on ...
MLF for everyone (users, implementers, and designers)
ML '07: Proceedings of the 2007 workshop on Workshop on MLMLF is an alternative to ML that permits second-order polymorphism as in System F but retains (partial) type inference a la ML. Type annotations are requested only on parameters of functions that are used polymorphically. Type abstractions and type ...
MLF: raising ML to the power of system F
ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programmingWe propose a type system MLF that generalizes ML with first-class polymorphism as in System F. Expressions may contain second-order type annotations. Every typable expression admits a principal type, which however depends on type annotations. Principal ...
Comments