skip to main content
10.1145/3546186.3549930acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Executable contracts for Elixir

Published:06 September 2022Publication History

ABSTRACT

This paper introduces a new library for implementing executable contracts in Elixir. In addition to classical contract constructs such as preconditions and postconditions, the library permits e.g. to specify exceptional behaviour (i.e. which exceptions are thrown and under which conditions), and to associate timers with function calls to detect non-terminating or too slow computations.

References

  1. Sergio Antoy and Michael Hanus. 2012. Contracts and Specifications for Functional Logic Programming. In PADL 2012, Claudio V. Russo and Neng-Fa Zhou (Eds.) (LNCS, Vol. 7149). Springer, 33–47. https://doi.org/10.1007/978-3-642-27694-1_4 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Mauricio Cassola, Agustín Talagorria, Alberto Pardo, and Marcos Viera. 2020. A Gradual Type System for Elixir. In Proceedings of the 24th Brazilian Symposium on Context-Oriented Programming and Advanced Modularity (SBLP ’20). Association for Computing Machinery, New York, NY, USA. 17–24. isbn:9781450389433 https://doi.org/10.1145/3427081.3427084 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Lars-Åke Fredlund, Julio Mariño, Sergio Pérez, and Salvador Tamarit. 2018. Runtime Verification in Erlang by Using Contracts. In Functional and Constraint Logic Programming - 26th International Workshop, WFLP 2018, Frankfurt/Main, Germany, September 6, 2018, Revised Selected Papers, Josep Silva (Ed.) (Lecture Notes in Computer Science, Vol. 11285). Springer, 56–73. https://doi.org/10.1007/978-3-030-16202-3_4 Google ScholarGoogle ScholarCross RefCross Ref
  4. K. Rustan M. Leino. 2010. Dafny: An Automatic Program Verifier for Functional Correctness. In Logic for Programming, Artificial Intelligence, and Reasoning - 16th International Conference, LPAR-16, Dakar, Senegal, April 25-May 1, 2010, Revised Selected Papers, Edmund M. Clarke and Andrei Voronkov (Eds.) (Lecture Notes in Computer Science, Vol. 6355). Springer, 348–370. https://doi.org/10.1007/978-3-642-17511-4_20 Google ScholarGoogle ScholarCross RefCross Ref
  5. Tobias Lindahl and Konstantinos Sagonas. 2006. Practical type inference based on success typings. In Proceedings of the 8th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, July 10-12, 2006, Venice, Italy, Annalisa Bossi and Michael J. Maher (Eds.). ACM, 167–178. https://doi.org/10.1145/1140335.1140356 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bertrand Meyer. 1992. Applying "Design by Contract". IEEE Computer, 25, 10 (1992), 40–51. https://doi.org/10.1109/2.161279 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Erlang Solutions. 2021. https://github.com/esl/gradient Accessed: 2022-06-21 Google ScholarGoogle Scholar
  8. Josef Svenningsson. 2019. https://github.com/josefs/Gradualizer Accessed: 2022-06-21 Google ScholarGoogle Scholar
  9. Elixir Toniq. 2019. https://github.com/elixir-toniq/norm Accessed: 2022-06-21 Google ScholarGoogle Scholar
  10. Jose Valim. 2011. https://hexdocs.pm/ex_unit/1.12/ExUnit.html Accessed: 2022-06-21 Google ScholarGoogle Scholar
  11. Wiebe-Marten Wijnja. 2022. TypeCheck - Effortless runtime type-checking. https://github.com/Qqwy/elixir-type_check In Elixir EU 2022. Google ScholarGoogle Scholar

Index Terms

  1. Executable contracts for Elixir

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                Erlang 2022: Proceedings of the 21st ACM SIGPLAN International Workshop on Erlang
                September 2022
                46 pages
                ISBN:9781450394352
                DOI:10.1145/3546186

                Copyright © 2022 ACM

                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 the author(s) 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].

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 6 September 2022

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                Overall Acceptance Rate51of68submissions,75%

                Upcoming Conference

                ICFP '24

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader