@@ -1,155 +1,155 @@
1−\documentclass{jfp1}
2−%\documentclass[acmtoplas]{acmtrans2m}
3−
4−\usepackage[draft]{comments}
5−%\usepackage[final]{comments}
6−% \newcommand{\comment}[2]{[#1: #2]}
7−\newcommand{\khcomment}[1]{\comment{KH}{#1}}
8−\newcommand{\ebcomment}[1]{\comment{EB}{#1}}
9−
10−\usepackage{epsfig}
11−%\usepackage{path}
12−\usepackage{url}
13−%\usepackage{amsmath,amssymb}
14−\usepackage{fancyvrb}
15−\usepackage{todonotes}
16−
17−\newenvironment{template}{\sffamily}
18−
19−\usepackage{graphics,epsfig}
20−\usepackage{stmaryrd}
21−
22−\input{./macros.ltx}
23−\input{./library.ltx}
24−
25−\NatPackage
26−\FinPackage
27−
28−\newcounter{per}
29−\setcounter{per}{1}
30−
31−\newcommand{\Ivor}{\textsc{Ivor}}
32−\newcommand{\Idris}{\textsc{Idris}}
33−\newcommand{\IdrisM}{\textsc{Idris}$^-$}
34−\newcommand{\TT}{\textsf{TT}}
35−\newcommand{\TTdev}{\textsf{TT$_{dev}$}}
36−\newcommand{\Funl}{\textsc{Funl}}
37−\newcommand{\Agda}{\textsc{Agda}}
38−\newcommand{\LamPi}{$\lambda_\Pi$}
39−
40−\newcommand{\perule}[1]{\vspace*{0.1cm}\noindent
41−\begin{center}
42−\fbox{
43−\begin{minipage}{7.5cm}\textbf{Rule \theper:} #1\addtocounter{per}{1}
44−\end{minipage}}
45−\end{center}
46−\vspace*{0.1cm}
47−}
48−
49−\newcommand{\mysubsubsection}[1]{
50−\noindent
51−\textbf{#1}
52−}
53−\newcommand{\hdecl}[1]{\texttt{#1}}
54−
55−
56−\title
57− {Implementing General Purpose Dependently Typed Programming Languages}
58−%\subtitle{Implementing Domain Specific Languages by Overloading}
59−
60−\author[Edwin Brady]
61−{EDWIN BRADY\\
62−School of Computer Science, University of St Andrews, St Andrews,
63−KY16 9SX, UK}
64−
65−\begin{document}
66−
67−\maketitle
68−
69−\begin{abstract}
70−Many components of a dependently typed programming language are by now well
71−understood, for example the underlying type theory, type checking, unification and
72−evaluation. How to combine these components into a realistic and usable high
73−level language is, however, folklore, discovered anew by successive
74−language implementations. In this paper, I describe the implementation of a
75−new dependently typed functional programming language, \Idris{}.
76−\Idris{} is intended to be a \emph{general purpose} programming language
77−and as such provides high level concepts such as implicit syntax,
78−type classes and \texttt{do} notation.
79−I describe the high level language and the underlying type theory, and present
80−a method for \emph{elaborating} concrete high level syntax with implicit
81−arguments and type classes into a fully explicit type theory. Furthermore,
82−I show how this method,
83−based on a domain specific language embedded in Haskell, facilitates the
84−implementation of new high level language constructs.
85−
86−%I describe the implementation of a dependently typed functional
87−%programming language, \Idris{}. Much has been written about various
88−%aspects of dependently typed language implementation (e.g. checking
89−%dependent types, unification, optimisation) but nothing yet about how
90−%to bring it all together into a complete, practical, usable tool. This paper
91−%attempts to do so. In particular, I explain what is needed to turn
92−%concrete syntax with implicit arguments into fully elaborated type
93−%theory, using unification and a tactic engine.
94−\end{abstract}
95−
96−
97−%\category{D.3.2}{Programming Languages}{Language
98−% Classifications}[Applicative (functional) Languages]
99−%\category{D.3.4}{Programming Languages}{Processors}[Compilers]
100−%\terms{Languages, Verification, Performance}
101−%\keywords{Dependent Types, Typechecking}
102−
103−
104−%\begin{bottomstuff}
105−%Author's address: Edwin Brady, School of Computer Science, North Haugh, St Andrews,
106−%KY16 9SX
107−%\end{bottomstuff}
108−
109−\input{intro.tex}
110−
111−%\input{overview.tex}
112−
113−\input{hll.tex}
114−
115−\input{typechecking.tex}
116−
117−%\input{proofstate.tex}
118−
119−\input{elaboration.tex}
120−
121−\input{delab.tex}
122−
123−%\input{compiling.tex}
124−
125−%\input{syntax.tex}
126−
127−\input{conclusions.tex}
128−
129−\section*{Acknowledgements}
130−
131−This work was funded by the Scottish Informatics and Computer Science
132−Alliance (SICSA) and by EU Framework 7 Project No. 248828 (ADVANCE).
133−My thanks to Kevin Hammond and Vilhelm Sj\"{o}berg for their comments
134−on an earlier draft of this paper.
135−
136−\bibliographystyle{jfp}
137−\bibliography{library.bib}
138−
139−\appendix
140−
141−%\section{TODOs}
142−%\listoftodos{}
143−
144−%\section{Elaboration meta-operations}
145−
146−%It's possible that it would be useful to have a quick reference of meta-operations
147−%used by the elaborator here.
148−
149−%They are: $\ttinterp{\cdot}$, $\MO{Elab}$, $\MO{TTDecl}$,
150−%$\MO{NewProof}$, $\MO{NewTerm}$,
151−%$\MO{Term}$, $\MO{Type}$, $\MO{Context}$, $\MO{Patterns}$, $\MO{Lift}$, $\MO{Expand}$.
152−
153−%\input{code}
154−
155−\end{document}
1+\documentclass{jfp1}
2+%\documentclass[acmtoplas]{acmtrans2m}
3+
4+\usepackage[draft]{comments}
5+%\usepackage[final]{comments}
6+% \newcommand{\comment}[2]{[#1: #2]}
7+\newcommand{\khcomment}[1]{\comment{KH}{#1}}
8+\newcommand{\ebcomment}[1]{\comment{EB}{#1}}
9+
10+\usepackage{epsfig}
11+%\usepackage{path}
12+\usepackage{url}
13+%\usepackage{amsmath,amssymb}
14+\usepackage{fancyvrb}
15+\usepackage{todonotes}
16+
17+\newenvironment{template}{\sffamily}
18+
19+\usepackage{graphics,epsfig}
20+\usepackage{stmaryrd}
21+
22+\input{./macros.ltx}
23+\input{./library.ltx}
24+
25+\NatPackage
26+\FinPackage
27+
28+\newcounter{per}
29+\setcounter{per}{1}
30+
31+\newcommand{\Ivor}{\textsc{Ivor}}
32+\newcommand{\Idris}{\textsc{Idris}}
33+\newcommand{\IdrisM}{\textsc{Idris}$^-$}
34+\newcommand{\TT}{\textsf{TT}}
35+\newcommand{\TTdev}{\textsf{TT$_{dev}$}}
36+\newcommand{\Funl}{\textsc{Funl}}
37+\newcommand{\Agda}{\textsc{Agda}}
38+\newcommand{\LamPi}{$\lambda_\Pi$}
39+
40+\newcommand{\perule}[1]{\vspace*{0.1cm}\noindent
41+\begin{center}
42+\fbox{
43+\begin{minipage}{7.5cm}\textbf{Rule \theper:} #1\addtocounter{per}{1}
44+\end{minipage}}
45+\end{center}
46+\vspace*{0.1cm}
47+}
48+
49+\newcommand{\mysubsubsection}[1]{
50+\noindent
51+\textbf{#1}
52+}
53+\newcommand{\hdecl}[1]{\texttt{#1}}
54+
55+
56+\title
57+ {Implementing General Purpose Dependently Typed Programming Languages}
58+%\subtitle{Implementing Domain Specific Languages by Overloading}
59+
60+\author[Edwin Brady]
61+{EDWIN BRADY\\
62+School of Computer Science, University of St Andrews, St Andrews,
63+KY16 9SX, UK}
64+
65+\begin{document}
66+
67+\maketitle
68+
69+\begin{abstract}
70+Many components of a dependently typed programming language are by now well
71+understood, for example the underlying type theory, type checking, unification and
72+evaluation. How to combine these components into a realistic and usable high
73+level language is, however, folklore, discovered anew by successive
74+language implementations. In this paper, I describe the implementation of a
75+new dependently typed functional programming language, \Idris{}.
76+\Idris{} is intended to be a \emph{general purpose} programming language
77+and as such provides high level concepts such as implicit syntax,
78+type classes and \texttt{do} notation.
79+I describe the high level language and the underlying type theory, and present
80+a method for \emph{elaborating} concrete high level syntax with implicit
81+arguments and type classes into a fully explicit type theory. Furthermore,
82+I show how this method,
83+based on a domain specific language embedded in Haskell, facilitates the
84+implementation of new high level language constructs.
85+
86+%I describe the implementation of a dependently typed functional
87+%programming language, \Idris{}. Much has been written about various
88+%aspects of dependently typed language implementation (e.g. checking
89+%dependent types, unification, optimisation) but nothing yet about how
90+%to bring it all together into a complete, practical, usable tool. This paper
91+%attempts to do so. In particular, I explain what is needed to turn
92+%concrete syntax with implicit arguments into fully elaborated type
93+%theory, using unification and a tactic engine.
94+\end{abstract}
95+
96+
97+%\category{D.3.2}{Programming Languages}{Language
98+% Classifications}[Applicative (functional) Languages]
99+%\category{D.3.4}{Programming Languages}{Processors}[Compilers]
100+%\terms{Languages, Verification, Performance}
101+%\keywords{Dependent Types, Typechecking}
102+
103+
104+%\begin{bottomstuff}
105+%Author's address: Edwin Brady, School of Computer Science, North Haugh, St Andrews,
106+%KY16 9SX
107+%\end{bottomstuff}
108+
109+\input{intro.tex}
110+
111+%\input{overview.tex}
112+
113+\input{hll.tex}
114+
115+\input{typechecking.tex}
116+
117+%\input{proofstate.tex}
118+
119+\input{elaboration.tex}
120+
121+\input{delab.tex}
122+
123+%\input{compiling.tex}
124+
125+%\input{syntax.tex}
126+
127+\input{conclusions.tex}
128+
129+\section*{Acknowledgements}
130+
131+This work was funded by the Scottish Informatics and Computer Science
132+Alliance (SICSA) and by EU Framework 7 Project No. 248828 (ADVANCE).
133+My thanks to Kevin Hammond and Vilhelm Sj\"{o}berg for their comments
134+on an earlier draft of this paper.
135+
136+\bibliographystyle{jfp}
137+\bibliography{library.bib}
138+
139+\appendix
140+
141+%\section{TODOs}
142+%\listoftodos{}
143+
144+%\section{Elaboration meta-operations}
145+
146+%It's possible that it would be useful to have a quick reference of meta-operations
147+%used by the elaborator here.
148+
149+%They are: $\ttinterp{\cdot}$, $\MO{Elab}$, $\MO{TTDecl}$,
150+%$\MO{NewProof}$, $\MO{NewTerm}$,
151+%$\MO{Term}$, $\MO{Type}$, $\MO{Context}$, $\MO{Patterns}$, $\MO{Lift}$, $\MO{Expand}$.
152+
153+%\input{code}
154+
155+\end{document}