Back to search

Durham University

Practical implementation of a dependently typed functional programming language

Abstract

dc:description.abstract

Types express a program's meaning, and checking types ensures that a program has the intended meaning. In a dependently typed programming language types are predicated on values, leading to the possibility of expressing invariants of a program's behaviour in its type. Dependent types allow us to give more detailed meanings to programs, and hence be more confident of their correctness. This thesis considers the practical implementation of a dependently typed programming language, using the Epigram notation defined by McBride and McKinna. Epigram is a high level notation for dependently typed functional programming elaborating to a core type theory based on Lu๙s UTT, using Dybjer's inductive families and elimination rules to implement pattern matching. This gives us a rich framework for reasoning about programs. However, a naive implementation introduces several run-time overheads since the type system blurs the distinction between types and values; these overheads include the duplication of values, and the storage of redundant information and explicit proofs. A practical implementation of any programming language should be as efficient as possible; in this thesis we see how the apparent efficiency problems of dependently typed programming can be overcome and that in many cases the richer type information allows us to apply optimisations which are not directly available in traditional languages. I introduce three storage optimisations on inductive families; forcing, detagging and collapsing. I further introduce a compilation scheme from the core type theory to G-machine code, including a pattern matching compiler for elimination rules and a compilation scheme for efficient run-time implementation of Peano's natural numbers. We also see some low level optimisations for removal of identity functions, unused arguments and impossible case branches. As a result, we see that a dependent type theory is an effective base on which to build a feasible programming language.

Degree

thesis:*
Name dc:type.qualificationname
PhD
Level dc:type.qualificationlevel
doctoral
Grantor dc:publisher.institution
Durham University
Year dc:date.issued
2005

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Brady, Edwin С.

Rights

Language dc:language.dcterms_iso639_2
eng

Identifiers

dc:identifier.*
Dc Identifier Grantnumber
UkUDh:CyT

Chain of custody

source
Harvested from
Durham University
Base URL
etheses.dur.ac.uk/cgi/oai2
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
related terms
citation

Brady, Edwin С.. Practical implementation of a dependently typed functional programming language. doctoral thesis, Durham University, 2005. https://etheses.durham.ac.uk/id/eprint/2800/