Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2034654.2034660acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Typed callbacks for more robust behaviours

Published: 23 September 2011 Publication History

Abstract

Behaviours are one of the most widely used features of Erlang/OTP. They offer a convenient and well-tested abstraction layer for frequently employed design patterns in concurrent Erlang programming. In effect, they allow programmers to focus on the functional characteristics of their applications without having to resort to Erlang's concurrency-supporting primitives. However, when it comes to ensuring that behaviours are properly used and callbacks are as expected, the current Erlang/OTP compiler performs only minimal checks. This is no fault of the compiler though, because most/all of the callbacks' API exists only in the documentation or the comments accompanying the code; as such, it cannot always be trusted and it is almost impossible to have it mechanically processed. In this paper, we propose a small extension to the language of function specifications of Erlang to allow the formal definition of the behaviours' callback API. We have implemented this extension on the development branch of Erlang/OTP and provide evidence of how it can be leveraged by static analysis tools such as Dialyzer to detect behaviour misuses.

Supplementary Material

MP4 File (_talk9.mp4)

References

[1]
J. Armstrong. Programming Erlang: Software for a Concurrent World. The Pragmatic Bookshelf, Raleigh, NC, 2007.
[2]
F. Cesarini and S. Thompson. Erlang Programming: A Concurrent Approach to Software Development. O'Reilly, 2009.
[3]
T. Lindahl and K. Sagonas. Detecting software defects in telecom applications through lightweight static analysis: A war story. In C. Wei-Ngan, editor, Programming Languages and Systems: Proceedings of the Second Asian Symposium, volume 3302 of LNCS, pages 91--106, Berlin, Germany, 2004. Springer.
[4]
T. Lindahl and K. Sagonas. Practical type inference based on success typings. In Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, pages 167--178, New York, NY, USA, 2006. ACM Press.
[5]
M. Logan, E. Merritt, and R. Carlsson. Erlang and OTP in Action. Manning, Stamford, CT, 2011.
[6]
Mnesia@PADL-99H. Mattsson, H. Nilsson, and C. Wikström. Mnesia - a distributed robust DBMS for telecommunications applications. In G. Gupta, editor, Practical Applications of Declarative Languages: Proceedings of the PADL'1999 Symposium, volume 1551 of LNCS, pages 152--163, Berlin, Germany, Jan. 1999. Springer.
[7]
K. Sagonas. Experience from developing the Dialyzer: A static analysis tool detecting defects in Erlang applications. In Proceedings of the ACM SIGPLAN Workshop on the Evaluation of Software Defect Detection Tools, 2005.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Erlang '11: Proceedings of the 10th ACM SIGPLAN workshop on Erlang
September 2011
108 pages
ISBN:9781450308595
DOI:10.1145/2034654
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 September 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. abstract classes
  2. behaviours
  3. erlang

Qualifiers

  • Research-article

Conference

ICFP '11
Sponsor:

Acceptance Rates

Erlang '11 Paper Acceptance Rate 10 of 14 submissions, 71%;
Overall Acceptance Rate 51 of 68 submissions, 75%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 120
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media