skip to main content
10.1145/378795.378797acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Design and implementation of generics for the .NET Common language runtime

Published:01 May 2001Publication History

ABSTRACT

The Microsoft.NET Common Language Runtime provides a shared type system, intermediate language and dynamic execution environment for the implementation and inter-operation of multiple source languages. In this paper we extend it with direct support for parametric polymorphism (also known as generics), describing the design through examples written in an extended version of the C# programming language, and explaining aspects of implementation by reference to a prototype extension to the runtime.

Our design is very expressive, supporting parameterized types, polymorphic static, instance and virtual methods, “F-bounded” type parameters, instantiation at pointer and value types, polymorphic recursion, and exact run-time types. The implementation takes advantage of the dynamic nature of the runtime, performing just-in-time type specialization, representation-based code sharing and novel techniques for efficient creation and use of run-time types.

Early performance results are encouraging and suggest that programmers will not need to pay an overhead for using generics, achieving performance almost matching hand-specialized code.

References

  1. 1.The .NET Common Language Runtime. See website at http://msdn.microsoft.com/net/.Google ScholarGoogle Scholar
  2. 2.O. Agesen, S. Freund, and J. C. Mitchell. Adding parameterized types to Java. In Object-Oriented Programming: Systems, Languages, Applications (OOPSLA), pages 215-230. ACM, 1997.Google ScholarGoogle Scholar
  3. 3.P. N. Benton, A. J. Kennedy, and G. Russell. Compiling Standard ML to Java bytecodes. In 3rd ACM SIGPLAN International Conference on Functional Programming, September 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.Gilad Bracha, Martin Odersky, David Stoutamire, and Philip Wadler. Making the future safe for the past: Adding genericity to the Java programming language. In Object-Oriented Programming: Systems, Languages, Applications (OOPSLA). ACM, October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Peter S. Canning, William R. Cook, Walter L. Hill, John C. Mitchell, and William Olthoff. F-bounded quantification for object-oriented programming. In Conference on Functional Programming Languages and Computer Architecture, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.R. Cartwright and G. L. Steele. Compatible genericity with run-time types for the Java programming language. In Object-Oriented Programming: Systems, Languages, Applications (OOPSLA), Vancouver, October 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.R. C. H. Connor. Types and Polymorphism in Persistent Programming Systems. PhD thesis, University of St. Andrews, 1990.Google ScholarGoogle Scholar
  8. 8.A. Gordon and D. Syme. Typing a multi-language intermediate code. In 27th Annual ACM Symposium on Principles of Programming Languages, January 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. In 22nd Annual ACM Symposium on Principles of Programming Languages, January 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.X. Leroy. Unboxed objects and polymorphic typing. In 19th Annual ACM Symposium on Principles of Programming Languages, pages 177-188, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, second edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.Y. Minamide. Full lifting of type parameters. Technical report, RIMS, Kyoto University, 1997.Google ScholarGoogle Scholar
  13. 13.A. Myers, J. Bank, and B. Liskov. Parameterized types for Java. In 24th Annual ACM Symposium on Principles of Programming Languages, pages 132-145, January 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.M. Odersky, P. Wadler, G. Bracha, and D. Stoutamire. Pizza into Java: Translating theory into practice. In ACM Symposium on Principles of Programming Languages, pages 146-159. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.Martin Odersky, Enno Runne, and Philip Wadler. Two Ways to Bake Your Pizza - Translating Parameterised Types into Java. Technical Report CIS-97-016, University of South Australia, 1997.Google ScholarGoogle Scholar
  16. 16.M. Viroli and A. Natali. Parametric polymorphism in Java: an approach to translation based on reflective features. In Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA). ACM, October 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.M. Viroli and A. Natali. Parametric polymorphism in Java through the homogeneous translation LM: Gathering type descriptors at loadtime. Technical Report DEIS-LIA-00-001, Universit~ degli Studi di Bologna, April 2000.Google ScholarGoogle Scholar

Index Terms

  1. Design and implementation of generics for the .NET Common language runtime

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PLDI '01: Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
        June 2001
        331 pages
        ISBN:1581134142
        DOI:10.1145/378795

        Copyright © 2001 ACM

        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: 1 May 2001

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        PLDI '01 Paper Acceptance Rate30of144submissions,21%Overall Acceptance Rate406of2,067submissions,20%

        Upcoming Conference

        PLDI '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader