ABSTRACT
Effect systems are used to statically reason about the effects an expression may have when evaluated. In the literature, such effects include various behaviours as diverse as memory accesses and exception throwing. Here we present CallƐ, an object-oriented language that takes a flexible approach where effects are just method calls: this works well because ordinary methods often model things like I/O operations, access to global state, or primitive language operations such as thread creation. CallƐ supports both flexible and fine-grained control over such behaviour, in a way designed to minimise the complexity of annotations.
CallƐ’s effect system can be used to prevent OO code from performing privileged operations, such as querying a database, modifying GUI widgets, exiting the program, or performing network communication. It can also be used to ensure determinism, by preventing methods from (indirectly) calling non-deterministic primitives like random number generation or file reading.
Supplemental Material
- Aaron Craig, Alex Potanin, Lindsay Groves, and Jonathan Aldrich. 2018. Capabilities: Effects for Free. In Formal Methods and Software Engineering, Jing Sun and Meng Sun (Eds.). Springer International Publishing, Cham, 231–247.Google Scholar
- D. Devriese, L. Birkedal, and F. Piessens. 2016. Reasoning about Object Capabilities with Logical Relations and Effect Parametricity. In 2016 IEEE European Symposium on Security and Privacy (EuroS P). 147–162. Google ScholarCross Ref
- C. Dimoulas, S. Moore, A. Askarov, and S. Chong. 2014. Declarative Policies for Capability Control. In 2014 IEEE 27th Computer Security Foundations Symposium. 3–17. Google ScholarDigital Library
- Burak Emir, Andrew Kennedy, Claudio Russo, and Dachuan Yu. 2006. Variance and Generalized Constraints for C ♯ Generics. In ECOOP 2006 – Object-Oriented Programming, Dave Thomas (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 279–303.Google ScholarDigital Library
- David K. Gifford and John M. Lucassen. 1986. Integrating Functional and Imperative Programming. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming (LFP ’86). ACM, New York, NY, USA, 28–38. Google ScholarDigital Library
- Colin S. Gordon, Werner Dietl, Michael D. Ernst, and Dan Grossman. 2013. JavaUI: Effects for Controlling UI Object Access. In ECOOP 2013 – Object-Oriented Programming, Giuseppe Castagna (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 179–204.Google Scholar
- James Gosling, Bill Joy, Guy Steele, and Bracha. Gilad. 2005. The Java Language Specification (3rd ed.). Addison-Wesley Longman Publishing Co., Boston, MA, USA.Google Scholar
- Aaron Greenhouse and John Boyland. 1999. An Object-Oriented Effects System. In Proceedings of the 13th European Conference on ObjectOriented Programming (ECOOP ’99). Springer-Verlag, London, UK, UK, 205–229. http://dl.acm.org/citation.cfm?id=646156.679836Google ScholarCross Ref
- Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. 2001. Featherweight Java: A Minimal Core Calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23, 3 (May 2001), 396–450. Google ScholarDigital Library
- Atsushi Igarashi and Mirko Viroli. 2006. Variant Parametric Types: A Flexible Subtyping Scheme for Generics. ACM Trans. Program. Lang. Syst. 28, 5 (Sept. 2006), 795–847. Google ScholarDigital Library
- Pablo Inostroza and Tijs van der Storm. 2018. JEff: Objects for Effect. In Proceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward! 2018). ACM, New York, NY, USA, 111–124. Google ScholarDigital Library
- Shin-ya Katsumata. 2014. Parametric Effect Monads and Semantics of Effect Systems. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14). ACM, New York, NY, USA, 633–645. Google ScholarDigital Library
- Daan Leijen. 2014. Koka: Programming with Row Polymorphic Effect Types. In Proceedings 5th Workshop on Mathematically Structured Functional Programming, MSFP@ETAPS 2014, Grenoble, France, 12 April 2014. 100–126. Google ScholarCross Ref
- Sam Lindley, Conor McBride, and Craig McLaughlin. 2017. Do Be Do Be Do. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017). ACM, New York, NY, USA, 500–514. Google ScholarDigital Library
- J. M. Lucassen and D. K. Gifford. 1988. Polymorphic Effect Systems. In Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’88). ACM, New York, NY, USA, 47– 57. Google ScholarDigital Library
- Daniel Marino and Todd Millstein. 2009. A Generic Type-and-effect System. In Proceedings of the 4th International Workshop on Types in Language Design and Implementation (TLDI ’09). ACM, New York, NY, USA, 39–50. Google ScholarDigital Library
- Darya Melicher, Yangqingwei Shi, Alex Potanin, and Jonathan Aldrich. 2017. A Capability-Based Module System for Authority Control. In 31st European Conference on Object-Oriented Programming (ECOOP 2017) (Leibniz International Proceedings in Informatics (LIPIcs)), Peter Müller (Ed.), Vol. 74. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 20:1–20:27. Google ScholarCross Ref
- Adrian Mettler, David A. Wagner, and Tyler Close. 2010. Joe-E: A Security-Oriented Subset of Java. In Proceedings of the Network and Distributed System Security Symposium, NDSS 2010, San Diego, California, USA, 28th February - 3rd March 2010. http://www.isoc.org/isoc/ conferences/ndss/10/pdf/20.pdfGoogle Scholar
- Mark Miller, Ka-Ping Yee, Jonathan Shapiro, and Combex Inc. 2003. Capability Myths Demolished. Technical Report.Google Scholar
- Flemming Nielson and Hanne Riis Nielson. 1999. Type and Effect Systems. In Correct System Design, Recent Insight and Advances, (to Hans Langmaack on the Occasion of His Retirement from His Professorship at the University of Kiel). Springer-Verlag, Berlin, Heidelberg, 114–136. http://dl.acm.org/citation.cfm?id=646005.673740Google Scholar
- Dominic Orchard and Tomas Petricek. 2014. Embedding Effect Systems in Haskell. In Proceedings of the 2014 ACM SIGPLAN Symposium on Haskell (Haskell ’14). ACM, New York, NY, USA, 13–24. Google ScholarDigital Library
- Gordon Plotkin and Matija Pretnar. 2009. Handlers of Algebraic Effects. In Proceedings of the 18th European Symposium on Programming Languages and Systems: Held As Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009 (ESOP ’09). SpringerVerlag, Berlin, Heidelberg, 80–94. Google ScholarDigital Library
- Alex Potanin, James Noble, Dave Clarke, and Robert Biddle. 2006. Generic Ownership for Generic Java. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications (OOPSLA ’06). ACM, New York, NY, USA, 311–324. Google ScholarDigital Library
- Lukas Rytz, Martin Odersky, and Philipp Haller. 2012. Lightweight Polymorphic Effects. In Proceedings of the 26th European Conference on Object-Oriented Programming (ECOOP’12). Springer-Verlag, Berlin, Heidelberg, 258–282. Google ScholarDigital Library
- Christian Skalka and Scott Smith. 2005. Static Use-based Object Confinement. Int. J. Inf. Secur. 4, 1-2 (Feb. 2005), 87–104. Google ScholarDigital Library
- Jean-Pierre Talpin and Pierre Jouvelot. 1992. Polymorphic Type, Region and Effect Inference. Journal of Functional Programming 2 (1992), 245– 271.Google ScholarCross Ref
- Yan Mei Tang and Pierre Jouvelot. 1994. Separate Abstract Interpretation for Control-Flow Analysis. In Proceedings of the International Conference on Theoretical Aspects of Computer Software (TACS ’94). Springer-Verlag, London, UK, UK, 224–243. http://dl.acm.org/citation. cfm?id=645868.668505Google ScholarDigital Library
- Yan Mei Tang and Pierre Jouvelot. 1995. Effect Systems with Subtyping. In Proceedings of the 1995 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation (PEPM ’95). ACM, New York, NY, USA, 45–53. Google ScholarDigital Library
- Ross Tate and Daan Leijen. 2010. Convenient explicit effects using type inference with subeffects. Technical Report.Google Scholar
- Philip Wadler and Peter Thiemann. 2003. The Marriage of Effects and Monads. ACM Trans. Comput. Logic 4, 1 (Jan. 2003), 1–32. Google ScholarDigital Library
Index Terms
- CallƐ: an effect system for method calls
Recommendations
Programming with permissions in Mezzo
ICFP '13We present Mezzo, a typed programming language of ML lineage. Mezzo is equipped with a novel static discipline of duplicable and affine permissions, which controls aliasing and ownership. This rules out certain mistakes, including representation ...
Contextual effects for version-consistent dynamic software updating and safe concurrent programming
POPL '08This paper presents a generalization of standard effect systems that we call contextual effects. A traditional effect system computes the effect of an expression e. Our system additionally computes the effects of the computational context in which e ...
Programming with permissions in Mezzo
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingWe present Mezzo, a typed programming language of ML lineage. Mezzo is equipped with a novel static discipline of duplicable and affine permissions, which controls aliasing and ownership. This rules out certain mistakes, including representation ...
Comments