Abstract
Motivated by a concrete goal, namely to extend Erlang with the ability to employ user-defined guards, we developed a parameterized static analysis tool called Purity, that classifies functions as referentially transparent (i.e., side-effect free with no dependency on the execution environment and never raising an exception), side-effect free with no dependencies but possibly raising exceptions, or side-effect free but with possible dependencies and possibly raising exceptions. We have applied Purity on a large corpus of Erlang code bases and report experimental results showing the percentage of functions that the analysis definitely classifies in each category. Moreover, we discuss how our analysis has been incorporated on a development branch of the Erlang/OTP compiler in order to allow extending the language with user-defined guards.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Agha, G.: Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1986)
Barklund, J., Virding, R.: Erlang 4.7.3 reference manual (February 1999), http://www.csd.uu.se/ftp/mirror/erlang/download/erl_spec47.ps.gz
Carlsson, R., Gustavsson, B., Johansson, E., Lindgren, T., Nyström, S.O., Pettersson, M., Virding, R.: Core Erlang 1.0 language specification. Tech. Rep. 030, Information Technology Department, Uppsala University (November 2000)
Carlsson, R., Gustavsson, B., Nyblom, P.: Erlangs exception handling revisited. In: Proceedings of the ACM SIGPLAN Workshop on Erlang, pp. 16–26. ACM (2004)
Ericsson, A.B.: Erlang Reference Manual Users Guide, version 5.8 (June 2010), http://www.erlang.org/doc/reference_manual/users_guide.html
Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, pp. 47–57. ACM, New York (January 1988)
Newbern, J.: All about monads, http://www.haskell.org/all_about_monads/
Pierce, B.C. (ed.): Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)
Plasmeijer, R., van Eekelen, M.: Clean Language Report, version 2.1 (November 2002), http://clean.cs.ru.nl/download/Clean20/doc/CleanLangRep.2.1.pdf
Shapiro, J., Sridhar, S., Doerrie, M.S.: The origins of the BitC programming language (April 2008), http://www.bitc-lang.org/docs/bitc/bitc-origins.html
de Vries, E., Plasmeijer, R., Abrahamson, D.M.: Uniqueness typing simplified. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 201–218. Springer, Heidelberg (2008)
Wadler, P.: The marriage of effects and monads. ACM SIGPLAN Notices 34(1), 63–74 (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pitidis, M., Sagonas, K. (2011). Purity in Erlang. In: Hage, J., Morazán, M.T. (eds) Implementation and Application of Functional Languages. IFL 2010. Lecture Notes in Computer Science, vol 6647. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24276-2_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-24276-2_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-24275-5
Online ISBN: 978-3-642-24276-2
eBook Packages: Computer ScienceComputer Science (R0)