Mnesia - A Distributed Robust DBMS for Telecommunications Applications
PADL '99 Proceedings of the First International Workshop on Practical Aspects of Declarative Languages
Practical type inference based on success typings
Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programming
Programming Erlang: Software for a Concurrent World
Programming Erlang: Software for a Concurrent World
ERLANG Programming
Erlang and OTP in Action
Hi-index | 0.00 |
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.