skip to main content
article
Public Access

The gradualizer: a methodology and algorithm for generating gradual type systems

Published:11 January 2016Publication History
Skip Abstract Section

Abstract

Many languages are beginning to integrate dynamic and static typing. Siek and Taha offered gradual typing as an approach to this integration that provides a coherent and full-span migration between the two disciplines. However, the literature lacks a general methodology for designing gradually typed languages. Our first contribution is to provide a methodology for deriving the gradual type system and the compilation to the cast calculus. Based on this methodology, we present the Gradualizer, an algorithm that generates a gradual type system from a well-formed type system and also generates a compiler to the cast calculus. Our algorithm handles a large class of type systems and generates systems that are correct with respect to the formal criteria of gradual typing. We also report on an implementation of the Gradualizer that takes a type system expressed in lambda-prolog and outputs its gradually typed version and a compiler to the cast calculus in lambda-prolog.

References

  1. ReferencesGoogle ScholarGoogle Scholar
  2. M. Abadi and L. Cardelli. A Theory of Objects. Springer-Verlag, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Ahmed, R. B. Findler, J. Matthews, and P. Wadler. Blame for all. In Workshop on Script to Program Evolution (STOP), July 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Ahmed, R. B. Findler, J. G. Siek, and P. Wadler. Blame for All. In Symposium on Principles of Programming Languages, January 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. Allende, O. Calla´u, J. Fabry, É. Tanter, and M. Denker. Gradual typing for Smalltalk. Science of Computer Programming, Aug. 2013. Available online. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Bierman, E. Meijer, and M. Torgersen. Adding dynamic types to C#. In European Conference on Object-Oriented Programming, ECOOP’10. Springer-Verlag, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Bierman, M. Abadi, and M. Torgersen. Understanding TypeScript. In R. Jones, editor, ECOOP 2014 – Object-Oriented Programming, volume 8586 of Lecture Notes in Computer Science, pages 257–281. Springer Berlin Heidelberg, 2014.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. K. Debray and D. S. Warren. Automatic mode inference for logic programs. J. Log. Program., 5(3):207–229, Sept. 1988. ISSN 0743- 1066.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. Disney and C. Flanagan. Gradual information flow typing. In Workshop on Script to Program Evolution, 2011.Google ScholarGoogle Scholar
  10. R. Garcia. Calculating threesomes, with blame. In ICFP ’13: Proceedings of the International Conference on Functional Programming, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. Garcia and M. Cimini. Principal type schemes for gradual programs. In Symposium on Principles of Programming Languages, POPL, pages 303–315, 2015.. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Garcia, A. M. Clark, and É. Tanter. Abstracting gradual typing. In Proceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St Petersburg, FL, USA, January 20-22. ACM Press, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Hejlsberg. Introducing TypeScript. Microsoft Channel 9 Blog, 2012.Google ScholarGoogle Scholar
  14. D. Herman, A. Tomb, and C. Flanagan. Space-efficient gradual typing. In Trends in Functional Prog. (TFP), page XXVIII, April 2007.Google ScholarGoogle Scholar
  15. D. Herman, A. Tomb, and C. Flanagan. Space-efficient gradual typing. Higher Order Symbol. Comput., 23(2):167–189, June 2010. ISSN 1388-3690. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. Ina and A. Igarashi. Gradual typing for generics. In Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications, OOPSLA ’11, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Jacobs. A pragmatic view of types for logic programs. In F. Pfenning, editor, Types in Logic Programming, Logic programming, pages 217–227. MIT Press, 1992.Google ScholarGoogle Scholar
  18. E. Meijer and P. Drayton. Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages. In OOPSLA’04 Workshop on Revival of Dynamic Languages, 2004.Google ScholarGoogle Scholar
  19. D. Miller and G. Nadathur. Programming with Higher-Order Logic. Cambridge University Press, New York, NY, USA, 1st edition, 2012. ISBN 052187940X, 9780521879408. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. U. S. Reddy. A typed foundation for directional logic programming. In E. Lamma and P. Mello, editors, Third International Workshop on Extensions of logic programming, pages 150–167, Bologna, Italy, 1993. Springer-Verlag LNAI 660. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Siek, M. Vitousek, M. Cimini, and J. Boyland. Refined Criteria for Gradual Typing. In Proceedings of the Inaugural Summit oN Advances in Programming Languages (SNAPL 2015), May 2015. To appear.Google ScholarGoogle Scholar
  23. J. G. Siek and W. Taha. Gradual typing for functional languages. In Scheme and Functional Programming Workshop, pages 81–92, September 2006.Google ScholarGoogle Scholar
  24. J. G. Siek and W. Taha. Gradual typing for objects. In European Conference on Object-Oriented Programming, volume 4609 of LCNS, pages 2–27, August 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. G. Siek and M. Vachharajani. Gradual typing and unification-based inference. In DLS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. G. Siek and P. Wadler. Threesomes, with and without blame. In Symposium on Principles of Programming Languages, POPL, pages 365–376, January 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. G. Siek, R. Garcia, and W. Taha. Exploring the design space of higher-order casts. In European Symposium on Programming, ESOP, pages 17–31, March 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. G. Siek, M. Vitousek, M. Cimini, S. Tobin-Hochstadt, and R. Garcia. Monotonic references for efficient gradual typing. In European Symposium on Programming, ESOP, 2015. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. G. Siek, M. M. Vitousek, M. Cimini, and J. T. Boyland. Refined criteria for gradual typing. In SNAPL: Summit on Advances in Programming Languages, LIPIcs: Leibniz International Proceedings in Informatics, May 2015.Google ScholarGoogle Scholar
  30. R. F. Stark. The declarative semantics of the prolog selection rule. In SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, pages 252– 261. IEEE Computer Society Press, 1994.Google ScholarGoogle Scholar
  31. A. Takikawa, T. S. Strickland, C. Dimoulas, S. Tobin-Hochstadt, and M. Felleisen. Gradual typing for first-class classes. In Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA ’12, pages 793–810, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Takikawa, D. Feltey, E. Dean, M. Flatt, R. B. Findler, S. Tobin-Hochstadt, and M. Felleisen. Towards practical gradual typing. In European Conference on Object-Oriented Programming, LIPICS. Dagstuhl Publishing, 2015.Google ScholarGoogle Scholar
  33. T. D. Team. Dart Programming Language Specification. Google, 1.2 edition, March 2014.Google ScholarGoogle Scholar
  34. P. Thiemann. Session types with gradual typing. In International Symposium on Trustworthy Global Computing, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  35. S. Tobin-Hochstadt and M. Felleisen. The design and implementation of Typed Scheme. In Symposium on Principles of Programming Languages, January 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. S. Tobin-Hochstadt and M. Felleisen. Logical types for untyped languages. In International Conference on Functional Programming, ICFP, pages 117–128. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. M. Vitousek, J. G. Siek, A. Kent, and J. Baker. Design and evaluation of gradual typing for Python. In Dynamic Languages Symposium, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. P. Wadler and R. B. Findler. Well-typed programs can’t be blamed. In European Symposium on Programming, ESOP, pages 1–16, March 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. R. Wolff, R. Garcia, E. Tanter, and J. Aldrich. Gradual typestate. In European Conference on Object-Oriented Programming, ECOOP’11. Springer-Verlag, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The gradualizer: a methodology and algorithm for generating gradual type systems

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 51, Issue 1
      POPL '16
      January 2016
      815 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2914770
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
        January 2016
        815 pages
        ISBN:9781450335492
        DOI:10.1145/2837614

      Copyright © 2016 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 11 January 2016

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!