Skip to main content

Purity in Erlang

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6647))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Agha, G.: Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1986)

    Google Scholar 

  2. 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

  3. 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)

    Google Scholar 

  4. Carlsson, R., Gustavsson, B., Nyblom, P.: Erlangs exception handling revisited. In: Proceedings of the ACM SIGPLAN Workshop on Erlang, pp. 16–26. ACM (2004)

    Google Scholar 

  5. Ericsson, A.B.: Erlang Reference Manual Users Guide, version 5.8 (June 2010), http://www.erlang.org/doc/reference_manual/users_guide.html

  6. 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)

    Google Scholar 

  7. Newbern, J.: All about monads, http://www.haskell.org/all_about_monads/

  8. Pierce, B.C. (ed.): Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)

    MATH  Google Scholar 

  9. 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

  10. 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

  11. 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)

    Chapter  Google Scholar 

  12. Wadler, P.: The marriage of effects and monads. ACM SIGPLAN Notices 34(1), 63–74 (1999)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics