Hostname: page-component-586b7cd67f-rdxmf Total loading time: 0 Render date: 2024-11-20T15:05:31.589Z Has data issue: false hasContentIssue false

Idris, a general-purpose dependently typed programming language: Design and implementation

Published online by Cambridge University Press:  18 October 2013

EDWIN BRADY*
Affiliation:
School of Computer Science, University of St Andrews, St Andrews KY16 9SX, UK (e-mail: ecb10@st-andrews.ac.uk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Many components of a dependently typed programming language are by now well understood, for example, the underlying type theory, type checking, unification and evaluation. How to combine these components into a realistic and usable high-level language is, however, folklore, discovered anew by successive language implementors. In this paper, I describe the implementation of Idris, a new dependently typed functional programming language. Idris is intended to be a general-purpose programming language and as such provides high-level concepts such as implicit syntax, type classes and do notation. I describe the high-level language and the underlying type theory, and present a tactic-based method for elaborating concrete high-level syntax with implicit arguments and type classes into a fully explicit type theory. Furthermore, I show how this method facilitates the implementation of new high-level language constructs.

Type
Articles
Copyright
Copyright © Cambridge University Press 2013 

References

Altenkirch, T., Danielsson, N. A., Löh, A. & Oury, N. (2010) Dependent types without the sugar. In Tenth International Symposium on Functional and Logic Programming (FLOPS 2010), Blume, M., Kobayashi, N. & Vidal, G. (eds), Lecture Notes in Computer Science 6009. Berlin, Germany: Springer, pp. 4055.CrossRefGoogle Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2011) The Matita Interactive theorem prover. In Automated Deduction – CADE-23, Lecture Notes in Computer Science, 6803. Berlin, Germany: Springer, pp. 6469.CrossRefGoogle Scholar
Asperti, A., Ricciotti, W., Coen, C. S. & Tassi, E. (2012) A bi-directional refinement algorithm for the calculus of (co)inductive constructions. Logical Methods Comput. Sci. 8, 149.Google Scholar
Augustsson, L. (1985) Compiling pattern matching. In Functional Programming Languages and Computer Architecture, Jouannaud, J.-P. (ed), Lecture Notes in Computer Science, vol. 201. Berlin, Germany: Springer, pp. 368381.CrossRefGoogle Scholar
Bertot, Y. & Castéran, P. (2004) Interactive Theorem Proving and Program Development: Coq'Art: the Calculus of Inductive Constructions. Berlin, Germany: Springer.CrossRefGoogle Scholar
Brady, E. (2005) Practical Implementation of a Dependently Typed Functional Programming Language, PhD thesis, University of Durham, Durham, NC.Google Scholar
Brady, E. (2006, September) Ivor, a proof engine. In Implementation and Application of Functional Languages (IFL'06), Budapest, Hungary, pp. 145162.Google Scholar
Brady, E. (2011a) Epic – A library for generating compilers. In Proceedings of the International Symposium on Trends in Functional Programming (TFP11), Madrid, Spain.Google Scholar
Brady, E. (2011b) Idris – Systems programming meets full dependent types. In Proceedings of the 5th ACM Workshop on Programming Languages Meets Program Verification (PLPV '11). New York, NY: ACM Press.Google Scholar
Brady, E. (2013). Programming in Idris : A Tutorial. Available at http://www.idris-lang.org/documentation/.Google Scholar
Brady, E., McBride, C. & McKinna, J. (2003) Inductive families need not store their indices. In Types for Proofs and Programs (TYPES 2003), Torino, Italy. Berlin, Germany: Springer.Google Scholar
Chapman, J., Altenkirch, T. & McBride, C. (2005). Epigram reloaded: A standalone typechecker for ETT. In Sixth Symposium on Trends in Functional Programming, Tallinn, Estonia.Google Scholar
Chapman, J., Dagand, P.-E., McBride, C. & Morris, P. (2010, September) The gentle art of levitation. In Proceedings of 15th ACM SIGPLAN International Conference on Functional Programming (ICFP '10), Baltimore, MD, vol. 45.Google Scholar
Coquand, T. (1986) An analysis of Girard's paradox. In Proceedings of the First IEEE Symposium on Logic in Computer Science ( LICS'86). Washington, DC: IEEE Comp. Soc. Press, pp. 227246.Google Scholar
Delahaye, D. (2000) A tactic language for the system Coq. In Logic for Programming and Automated Reasoning (LPAR). New York, NY: Springer, pp. 8595.CrossRefGoogle Scholar
Dybjer, P. (1994) Inductive families. Form. Asp. Comput. 6 (4), 440465.CrossRefGoogle Scholar
Hancock, P. & Setzer, A. (2000, August) Interactive programs in dependent type theory. In Proceedings of the 14th Annual Conference of the EACSL on Computer Science Logic, Oxford, UK, pp. 317331.Google Scholar
Huet, G. (1997) The zipper. J. Funct. Program. 7 (5), 549554.CrossRefGoogle Scholar
Kimmell, G., Stump, A., Eades, H. D. III, Fu, P., Sheard, T., Weirich, S., Casinghino, C., Sjöberg, V., Collins, N. & Ahn, K. Y. (2012) Equational reasoning about programs with general recursion and call-by-value semantics. In Proceedings of the 6th ACM workshop on Programming Languages Meets Program Verification (PLPV '12), Philadelphia, PA.Google Scholar
Lee, C. S., Jones, N. D. & Ben-Amram, A. M. (2001) The size-change principle for program termination. ACM SIGPLAN Not. 36 (3), 8192.CrossRefGoogle Scholar
Löh, A., McBride, C. & Swierstra, W. (2010) A tutorial implementation of a dependently typed lambda calculus. Fundamenta Informaticae 102(2), 177207.CrossRefGoogle Scholar
Luo, Z. (1994) Computation and Reasoning: A Type Theory for Computer Science. Oxford, UK: Oxford University Press.CrossRefGoogle Scholar
McBride, C. (1999) Dependently Typed Functional Programs and their Proofs, PhD thesis, University of Edinburgh, Edinburgh, UK.Google Scholar
McBride, C. (2000) Elimination with a motive. In Types for Proofs and Programs (TYPES 2000), Durham, UK.Google Scholar
McBride, C., Goguen, H. & McKinna, J. (2006). A few constructions on constructors. In Types for Proofs and Programs (TYPES 2006), Nottingham, UK.Google Scholar
McBride, C. & McKinna, J. (2004) The view from the left. J. Funct. Program. 14 (1), 69111.CrossRefGoogle Scholar
McBride, C. & Paterson, R. (2008) Applicative programming with effects. J. Funct. Program. 18 (1), 113.CrossRefGoogle Scholar
Miller, D. (1992). Unification under a mixed prefix. J. Symb. Comput. 14, 321358.CrossRefGoogle Scholar
Norell, U. (2007). Towards a Practical Programming Language Based on Dependent Type Theory, PhD thesis, Chalmers University of Technology, Sweden.Google Scholar
Peyton Jones, S., Vytiniotis, D., Weirich, S. & Washburn, G. (2006) Simple unification-based type inference for GADTs. In International Conference on Functional Programming (ICFP '06), vol. 41. New York, NY: ACM, pp. 5061.Google Scholar
Pollack, R. (1990). Implicit syntax. In Informal Proceedings of First Workshop on Logical Frameworks, Antibes. Citeseer.Google Scholar
Sozeau, M. & Oury, N. (2008) First-class type classes. In Theorem Proving in Higher Order Logics (TPHOLs 2008), Montreal, Canada, pp. 278293.CrossRefGoogle Scholar
Vytiniotis, D., Peyton Jones, S., Schrijvers, T. & Sulzmann, M. (2011) OutsideIn(X) modular type inference with local assumptions. J. Funct. Program. 21 (4–5), 333412.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.