on master help sign in
Abstract
9d389c4Edwin Brady
impl-paper/impldtp.tex+24−8
@@ -66,14 +66,30 @@ KY16 9SX, UK}
66\maketitle
66\maketitle
67
67
68\begin{abstract}
68\begin{abstract}
69+Many components of a dependently typed programming language are by now well
70+understood, such as the underlying type theory, type checking, unification and
71+evaluation. How to combine these components into a realistic and usable high
72+level language is, however, folklore, discovered anew by each succesive
73+language implementations. In this paper, I describe the implementation of a
74+new dependently typed functional programming language, \Idris{}.
75+\Idris{} is intended to be a \emph{general purpose} programming language
76+and as such provides high level concepts such as implicit syntax,
77+type classes and \texttt{do} notation.
78+I describe the high level language and the underlying type theory, and present
79+a method for \emph{elaborating} concrete high level syntax with implicit
80+arguments and type classes into a fully explicit type theory. Furthermore,
81+I show how this method,
82+based on a domain specific language embedded in Haskell, facilitates the
83+implementation of new high level language constructs.
84+
69−I describe the implementation of a dependently typed functional
85+%I describe the implementation of a dependently typed functional
70−programming language, \Idris{}. Much has been written about various
86+%programming language, \Idris{}. Much has been written about various
71−aspects of dependently typed language implementation (e.g. checking
87+%aspects of dependently typed language implementation (e.g. checking
72−dependent types, unification, optimisation) but nothing yet about how
88+%dependent types, unification, optimisation) but nothing yet about how
73−to bring it all together into a complete, practical, usable tool. This paper
89+%to bring it all together into a complete, practical, usable tool. This paper
74−attempts to do so. In particular, I explain what is needed to turn
90+%attempts to do so. In particular, I explain what is needed to turn
75−concrete syntax with implicit arguments into fully elaborated type
91+%concrete syntax with implicit arguments into fully elaborated type
76−theory, using unification and a tactic engine.
92+%theory, using unification and a tactic engine.
77\end{abstract}
93\end{abstract}
78
94
79%\category{D.3.2}{Programming Languages}{Language
95%\category{D.3.2}{Programming Languages}{Language
impl-paper/intro.tex+14−12
@@ -4,43 +4,45 @@ Dependently typed programming languages, such as Agda \cite{norell2007thesis}
4and Coq \cite{Bertot2004}, have emerged in recent years as a promising approach
4and Coq \cite{Bertot2004}, have emerged in recent years as a promising approach
5to ensuring the correctness of software. The \Idris{} language
5to ensuring the correctness of software. The \Idris{} language
6\cite{Brady2011a} aims to take these ideas further, by providing support for
6\cite{Brady2011a} aims to take these ideas further, by providing support for
7−verification of general-purpose systems software. In contrast to Agda and Coq,
7+verification of general purpose systems software. In contrast to Agda and Coq,
8which have arisen from the theorem proving community, \Idris{} takes Haskell as
8which have arisen from the theorem proving community, \Idris{} takes Haskell as
9−its baseline. Recent Haskell extensions such as GADTs and type families have
9+its main influence. Recent Haskell extensions such as GADTs and type families have
10−given some of the power of dependent types to Haskell programmers. However,
10+given some of the power of dependent types to Haskell programmers. In the short
11+term this approach has a clear advantage, since it builds on a mature language
12+infrastructure with extensive library support.
13+Taking a longer term view, however,
11these extensions are inherently limited in that they are required to maintain
14these extensions are inherently limited in that they are required to maintain
12−backwards compatibility with existing Haskell programs. \Idris{}, being a new
15+backwards compatibility with existing Haskell implemtations. \Idris{}, being a new
13language, has no such limitation, essentially asking the question:
16language, has no such limitation, essentially asking the question:
14
17
15\begin{center}
18\begin{center}
16\emph{``What if Haskell had \emph{full} dependent types?''}
19\emph{``What if Haskell had \emph{full} dependent types?''}
17\end{center}
20\end{center}
18
21
19−It is important, for the sake of usability of a programming language, to provide
22+It is important for the sake of usability of a programming language to provide
20a notation which allows programmers to express high level concepts
23a notation which allows programmers to express high level concepts
21in a natural way. Taking Haskell as a starting point means that \Idris{} offers
24in a natural way. Taking Haskell as a starting point means that \Idris{} offers
22high level structures such as type classes, \texttt{do}-notation, primitive types
25high level structures such as type classes, \texttt{do}-notation, primitive types
23and monadic I/O, for example.
26and monadic I/O, for example.
24Nevertheless, it is important for the sake of correctness of the language implementation
27Nevertheless, it is important for the sake of correctness of the language implementation
25to have a small core language with well understood meta-theory
28to have a small core language with well understood meta-theory
26−\cite{Altenkirch2010}.
29+\cite{Altenkirch2010}.
27−
28How can we achieve both of these goals?
30How can we achieve both of these goals?
29
31
30This paper describes a method for elaborating a high level dependently typed
32This paper describes a method for elaborating a high level dependently typed
31functional programming language to a low level core language based on dependent
33functional programming language to a low level core language based on dependent
32type theory. The method involves building an Embedded Domain Specific Language
34type theory. The method involves building an Embedded Domain Specific Language
33(EDSL) for constructing programs in the core language, using \emph{tactics}
35(EDSL) for constructing programs in the core language, using \emph{tactics}
34−directed by high level
36+directed by high level program syntax.
35−program syntax.
36−%This method allows higher level language constructs to be
37+As we shall see, this method allows higher level language constructs to be
37−%constructed in a straightforward manner.
38+constructed in a straightforward manner, without compromising the simplicity
39+of the underlying type theory.
38
40
39\subsection{Overview}
41\subsection{Overview}
40
42
41A dependently typed programming language relies on several components, many of
43A dependently typed programming language relies on several components, many of
42which are now well understood. For example, we rely on a type checker for
44which are now well understood. For example, we rely on a type checker for
43−the underlying type theory \cite{Chapman2005epigram,loh2010tutorial}, a
45+the core type theory \cite{Chapman2005epigram,loh2010tutorial}, a
44unification algorithm \cite{Miller1992} and an evaluator. However, it is less
46unification algorithm \cite{Miller1992} and an evaluator. However, it is less
45well understood how to combine these components effectively into a practical
47well understood how to combine these components effectively into a practical
46programming language. Therefore, the primary contribution of this paper is
48programming language. Therefore, the primary contribution of this paper is