Nothing Special   »   [go: up one dir, main page]

skip to main content
article

An interoperable calculus for external object access

Published: 17 September 2002 Publication History

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.

References

[1]
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.
[2]
L. Cardelli. A semantics of multiple inheritance. In Semantics of Data Types, Lecture Notes in Computer Science 173. Springer-Verlag, 1984.
[3]
L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471--522, Dec. 1985.
[4]
M. Corporation and D. Corporation. The component object model specification, 1995.
[5]
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.
[6]
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.
[7]
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.
[8]
Y.-C. Fuh and P. Mishra. Type inference with subtypes. In Proceedings of ESOP '88, pages 94--114, 1988. Springer LNCS 300.
[9]
C. Gunter and J. Mitchell, editors. Theoretical Aspects of Object-Oriented Programming. MIT Press, 1994.
[10]
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.
[11]
X. Leroy. Polymorphic typing of an algorithmic language. PhD thesis, University of Paris VII, 1992.
[12]
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.)
[13]
T. Lindholm and F. Yellin. The Java virtual machine specification. Addison Wesley, second edition edition, 1999.
[14]
E. Meijer and K. Claessen. The design and implementation of Mondrian. In Haskell Workshop. ACM, June 1997.
[15]
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.
[16]
J. Mitchell. Type inference and type containment. In Semantics of Data Types, Lecture Notes in Computer Science 173, pages 257--277. Springer-Verlag, 1984.
[17]
J. Nordlander. Pragmatic subtyping in polymorphic languages. In International Conference on Functional Programming (ICFP), 1998.
[18]
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".
[19]
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.
[20]
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.
[21]
R. Stansifer. Type inference with subtypes. In Proc. ACM Symposium on Principles of Programming Languages, pages 88--97, 1988.

Index Terms

  1. An interoperable calculus for external object access

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 37, Issue 9
    September 2002
    283 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/583852
    Issue’s Table of Contents
    • cover image ACM Conferences
      ICFP '02: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
      October 2002
      294 pages
      ISBN:1581134878
      DOI:10.1145/581478
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 17 September 2002
    Published in SIGPLAN Volume 37, Issue 9

    Check for updates

    Author Tags

    1. Java
    2. ML
    3. interoperability
    4. object-oriented language
    5. record polymorphism
    6. type inference

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 326
      Total Downloads
    • Downloads (Last 12 months)4
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 10 Nov 2024

    Other Metrics

    Citations

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media