skip to main content
research-article

Customizable gradual polymorphic effects for Scala

Published:23 October 2015Publication History
Skip Abstract Section

Abstract

Despite their obvious advantages in terms of static reasoning, the adoption of effect systems is still rather limited in practice. Recent advances such as generic effect systems, lightweight effect polymorphism, and gradual effect checking, all represent promising steps towards making effect systems suitable for widespread use. However, no existing system combines these approaches: the theory of gradual polymorphic effects has not been developed, and there are no implementations of gradual effect checking. In addition, a limiting factor in the adoption of effect systems is their unsuitability for localized and customized effect disciplines. This paper addresses these issues by presenting the first implementation of gradual effect checking, for Scala, which supports both effect polymorphism and a domain-specific language called Effscript to declaratively define and customize effect disciplines. We report on the theory, implementation, and practical application of the system.

Skip Supplemental Material Section

Supplemental Material

References

  1. M. Abadi, A. Birrell, T. Harris, and M. Isard. Semantics of transactional memory and automatic mutual exclusion. In Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2008), pages 63–74, San Francisco, CA, USA, Jan. 2008. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Abadi, C. Flanagan, and S. N. Freund. Types for safe locking: Static race detection for Java. ACM Transactions on Programming Languages and Systems, 28(2):207–255, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Ahmed, R. B. Findler, J. G. Siek, and P. Wadler. Blame for all. In Proceedings of the 38th annual ACM SIGPLANSIGACT symposium on Principles of programming languages (POPL 2011), pages 201–214, Austin, Texas, USA, Jan. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ACM Press.Google ScholarGoogle Scholar
  5. C. Andreae, J. Noble, S. Markstrum, and T. Millstein. A framework for implementing pluggable type systems. In Proceedings of the 21st ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2006), pages 57–74, Portland, Oregon, USA, Oct. 2006. ACM Press. ACM SIGPLAN Notices, 41(10). Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. F. Ba˜nados, R. Garcia, and É. Tanter. A theory of gradual effect systems. In Proceedings of the 19th ACM SIGPLAN Conference on Functional Programming (ICFP 2014), pages 283–295, Gothenburg, Sweden, Sept. 2014. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Benton and P. Buchlovsky. Semantics of an effect analysis for exceptions. In Proceedings of the 2007 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI 2007), pages 15–26. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. M. Bierman, M. Abadi, and M. Torgersen. Understanding TypeScript. In R. Jones, editor, Proceedings of the 28th European Conference on Object-oriented Programming (ECOOP 2014), volume 8586 of Lecture Notes in Computer Science, pages 257–281, Uppsala, Sweden, July 2014. Springer-Verlag.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Bracha. Pluggable type systems. In Workshop on Revival of Dynamic Languages, 2004.Google ScholarGoogle Scholar
  10. P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the 4th ACM Symposium on Principles of Programming Languages (POPL 77), pages 238–252, Los Angeles, CA, USA, Jan. 1977. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. S. Dantas, D. Walker, G. Washburn, and S. Weirich. AspectML: A polymorphic aspect-oriented functional programming language. ACM Transactions on Programming Languages and Systems, 30(3):Article No. 14, May 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. W. Dietl, S. Dietzel, M. D. Ernst, K. Muslu, and T. W. Schiller. Building and using pluggable type-checkers. In Proceedings of the 33rd International Conference on Software Engineering (ICSE 2011), pages 681–690, Hawaii, USA, May 2011. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. T. Disney and C. Flanagan. Gradual information flow typing. In International Workshop on Scripts to Programs, 2011.Google ScholarGoogle Scholar
  14. C. Dutchyn, D. B. Tucker, and S. Krishnamurthi. Semantics and scoping of aspects in higher-order languages. Science of Computer Programming, 63(3):207–239, Dec. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Fabry, T. Dinkelaker, J. Noyé, and É. Tanter. A taxonomy of domain-specific aspect languages. ACM Computing Surveys, 47(3):40:1–40:44, Apr. 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. L. Fennell and P. Thiemann. Gradual security typing with references. In Proceedings of the 26th Computer Security Foundations Symposium (CSF), pages 224–239, June 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. Garcia, É. Tanter, R. Wolff, and J. Aldrich. Foundations of typestate-oriented programming. ACM Transactions on Programming Languages and Systems, 36(4):12:1–12:44, Oct. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. K. Gifford and J. M. Lucassen. Integrating functional and imperative programming. In Proceedings of the ACM Conference on LISP and Functional Programming (LFP ’86), pages 28–38, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. S. Gordon, W. Dietl, M. D. Ernst, and D. Grossman. Java U I : Effects for controlling UI object access. In G. Castagna, editor, Proceedings of the 27th European Conference on Object-oriented Programming (ECOOP 2013), volume 7920 of Lecture Notes in Computer Science, pages 179–204, Montpellier, France, July 2013. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification, Third Edition. Addison-Wesley, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396–450, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. G. Kiczales, J. des Rivières, and D. G. Bobrow. The Art of the Metaobject Protocol. MIT Press, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. Griswold. An overview of AspectJ. In J. L. Knudsen, editor, Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP 2001), number 2072 in Lecture Notes in Computer Science, pages 327–353, Budapest, Hungary, June 2001. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Kiczales, J. Lamping, C. V. Lopes, C. Maeda, A. Mendhekar, and G. Murphy. Open implementation design guidelines. In Proceedings of the 19th International Conference on Software Engineering (ICSE 97), pages 481–490, Boston, Massachusetts, USA, 1997. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. V. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In M. Aks¸it and S. Matsuoka, editors, Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP 97), volume 1241 of Lecture Notes in Computer Science, pages 220–242, Jyväskylä, Finland, June 1997. Springer-Verlag.Google ScholarGoogle ScholarCross RefCross Ref
  26. J. Lamping, G. Kiczales, L. H. R. Jr., and E. Ruf. An architecture for an open compiler. In Proceedings of the IMSA 92 Workshop on Reflection and Meta-Level Architectures, pages 95–106. Akinori Yonezawa and Brian C. Smith, editors, 1992.Google ScholarGoogle Scholar
  27. D. Leijen. Koka: Programming with row polymorphic effect types. In Mathematically Structured Functional Programming. Electronic Proceedings in Theoretical Computer Science, Mar. 2014.Google ScholarGoogle ScholarCross RefCross Ref
  28. D. Marino and T. Millstein. A generic type-and-effect system. In Proceedings of the ACM SIGPLAN International Workshop on Types in Language Design and Implementation, pages 39– 50, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Matthews and A. Ahmed. Parametric polymorphism through run-time sealing, or, theorems for low, low prices! In S. Drossopoulou, editor, Proceedings of the 17th European Symposium on Programming Languages and Systems (ESOP 2008), volume 4960 of Lecture Notes in Computer Science, pages 16–31, Budapest, Hungary, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. C. Pierce and D. N. Turner. Local type inference. ACM Trans. Program. Lang. Syst., 22(1):1–44, Jan. 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. L. Rytz. A Practical Effect System for Scala. PhD thesis, École Polytechnique Fédérale de Lausanne, Sept. 2013.Google ScholarGoogle Scholar
  32. L. Rytz, N. Amin, and M. Odersky. A flow-insensitive, modular effect system for purity. In Proceedings of the Workshop on Formal Techniques for Java-like Programs, 2013. Article No.: 4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. L. Rytz, M. Odersky, and P. Haller. Lightweight polymorphic effects. In J. Noble, editor, Proceedings of the 26th European Conference on Object-oriented Programming (ECOOP 2012), volume 7313 of Lecture Notes in Computer Science, pages 258–282, Beijing, China, June 2012. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. I. Sergey and D. Clarke. Gradual ownership types. In H. Seidl, editor, Proceedings of the 21st European Symposium on Programming Languages and Systems (ESOP 2012), volume 7211 of Lecture Notes in Computer Science, pages 579– 599, Tallinn, Estonia, 2012. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. Siek and W. Taha. Gradual typing for functional languages. In Proceedings of the Scheme and Functional Programming Workshop, pages 81–92, Sept. 2006.Google ScholarGoogle Scholar
  36. P. Thiemann and L. Fennell. Gradual typing for annotated type systems. In Z. Shao, editor, Proceedings of the 23rd European Symposium on Programming Languages and Systems (ESOP 2014), volume 8410 of Lecture Notes in Computer Science, pages 47–66, Grenoble, France, 2014. Springer-Verlag.Google ScholarGoogle Scholar
  37. R. Toledo, P. Leger, and É. Tanter. AspectScript: Expressive aspects for the Web. In Proceedings of the 9th ACM International Conference on Aspect-Oriented Software Development (AOSD 2010), pages 13–24, Rennes and Saint Malo, France, Mar. 2010. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. Toro and É. Tanter. Gradual polymorphic effects— complete definition and soundness proof. Technical Report TR/DCC-2015-2, University of Chile, July 2015.Google ScholarGoogle Scholar
  39. Typesafe Inc. Slick functional relational mapping for Scala. http://slick.typesafe.com/.Google ScholarGoogle Scholar
  40. Typesafe, Inc. Play framework, 2007. http://www. playframework.com/.Google ScholarGoogle Scholar

Index Terms

  1. Customizable gradual polymorphic effects for Scala

        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 50, Issue 10
          OOPSLA '15
          October 2015
          953 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2858965
          • Editor:
          • Andy Gill
          Issue’s Table of Contents
          • cover image ACM Conferences
            OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
            October 2015
            953 pages
            ISBN:9781450336895
            DOI:10.1145/2814270

          Copyright © 2015 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 23 October 2015

          Check for updates

          Qualifiers

          • research-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!