Results 1 - 10
of
25
A functional specification of effects
, 2009
"... This dissertation is about effects and type theory. Functional programming languages such as Haskell demonstrate that monads can safely encapsulated side effects. If you want to reason about effectful code, however, it is not enough to only encapsulate effects: you must explain their meaning. In thi ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
This dissertation is about effects and type theory. Functional programming languages such as Haskell demonstrate that monads can safely encapsulated side effects. If you want to reason about effectful code, however, it is not enough to only encapsulate effects: you must explain their meaning. In this dissertation I provide pure specifications of effects in type theory. After initial investigations using Haskell, I show how such specifications can be made total in a language with dependent types. Hoare Type Theory takes an alternative approach to incorporating effects in a dependently typed language. Instead of giving functional specifications, they follow Haskell’s lead and postulate the existence of primitive functions. This dissertation shows how some of these primitives may be implemented in a programming language with dependent types. I believe that functional specifications may provide the foundations on top of which richer logics may be constructed. The results presented in this dissertation may be used to write and verify
Dependent Types for Distributed Arrays
"... Abstract. Locality-aware algorithms over distributed arrays can be very difficult to write. Yet such algorithms are becoming more and more important as desktop machines boast more and more processors. We show how a dependently-typed programming language can help develop such algorithms by hosting a ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
Abstract. Locality-aware algorithms over distributed arrays can be very difficult to write. Yet such algorithms are becoming more and more important as desktop machines boast more and more processors. We show how a dependently-typed programming language can help develop such algorithms by hosting a domain-specific embedded type system that ensures every well-typed program will only ever access local data. Such static guarantees can help catch programming errors early on in the development cycle and maximise the potential speedup that multicore machines offer. At the same time, the functional specification of effects we provide facilitates the testing of and reasoning about algorithms on distributed arrays. 1
Unembedding Domain-Specific Languages
"... Higher-order abstract syntax provides a convenient way of embedding domain-specific languages, but is awkward to analyse and manipulate directly. We explore the boundaries of higher-order abstract syntax. Our key tool is the unembedding of embedded terms as de Bruijn terms, enabling intensional anal ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
Higher-order abstract syntax provides a convenient way of embedding domain-specific languages, but is awkward to analyse and manipulate directly. We explore the boundaries of higher-order abstract syntax. Our key tool is the unembedding of embedded terms as de Bruijn terms, enabling intensional analysis. As part of our solution we present techniques for separating the definition of an embedded program from its interpretation, giving modular extensions of the embedded language, and different ways to encode the types of the embedded language.
Position: Lightweight Static Resources: Sexy types for embedded and systems programming
- In TFP ’07, the 8 th Symposium on Trends in Functional Programming
, 2007
"... It is an established trend to develop low-level code—embedded software, device drivers, and operating systems—using high-level languages, especially functional languages with advanced facilities to abstract and generate code. To be reliable and secure, low-level code must correctly manage space, tim ..."
Abstract
-
Cited by 5 (3 self)
- Add to MetaCart
It is an established trend to develop low-level code—embedded software, device drivers, and operating systems—using high-level languages, especially functional languages with advanced facilities to abstract and generate code. To be reliable and secure, low-level code must correctly manage space, time, and other resources, so special type systems and verification tools arose to regulate resource access statically. However, a general-purpose functional language practical today can provide the same static assurances, also without run-time overhead. We substantiate this claim and promote the trend with two security kernels in the domain of device drivers: 1. one built around raw pointers, to track and arbitrate the size, alignment, write permission, and other properties of memory areas across indexing and casting; 2. the other built around a device register, to enforce protocol and timing requirements while reading from the register. Our style is convenient in Haskell thanks to custom kinds and predicates (as type classes); type-level numbers, functions, and records (using functional dependencies); and mixed type- and term-level programming (enabling partial type signatures). 1
The essence of form abstraction
- In APLAS
, 2008
"... Abstract. Abstraction is the cornerstone of high-level programming; HTML forms are the principal medium of web interaction. However, most web programming environments do not support abstraction of form components, leading to a lack of compositionality. Using a semantics based on idioms, we show how ..."
Abstract
-
Cited by 5 (3 self)
- Add to MetaCart
Abstract. Abstraction is the cornerstone of high-level programming; HTML forms are the principal medium of web interaction. However, most web programming environments do not support abstraction of form components, leading to a lack of compositionality. Using a semantics based on idioms, we show how to support compositional form construction and give a convenient syntax. 1
Fun with type functions
, 2010
"... Tony Hoare has always been a leader in writing down and proving properties of programs. To prove properties of programs automatically, the most widely used technology today is by far the ubiquitous type checker. Alas, static type systems inevitably exclude some good programs and allow some bad ones. ..."
Abstract
-
Cited by 4 (3 self)
- Add to MetaCart
Tony Hoare has always been a leader in writing down and proving properties of programs. To prove properties of programs automatically, the most widely used technology today is by far the ubiquitous type checker. Alas, static type systems inevitably exclude some good programs and allow some bad ones. Thus motivated, we describe some fun we have been having with Haskell, by making the type system more expressive without losing the benefits of automatic proof and compact expression. Specifically, we offer a programmer’s tour of so-called type families, a recent extension to Haskell that allows functions on types to be expressed as straightforwardly as functions on values. This facility makes it easier for programmers to effectively extend the compiler by writing functional programs that execute during type-checking. This paper gives a programmer’s tour of type families as they are supported in GHC. Source code for all the examples is available at
A monadic formalization of ML5
- In Pre-preceedings of Workshop on Logical Frameworks and Metalanguages: Theory and Practice
, 2010
"... ML5 is a programming language for spatially distributed computing, based on a Curry-Howard correspondence with the modal logic S5. However, the ML5 programming language differs from the logic in several ways. In this paper, we give a semantic embedding of ML5 into the dependently typed programming l ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
ML5 is a programming language for spatially distributed computing, based on a Curry-Howard correspondence with the modal logic S5. However, the ML5 programming language differs from the logic in several ways. In this paper, we give a semantic embedding of ML5 into the dependently typed programming language Agda, which both explains these discrepancies between ML5 and S5 and suggests some simplifications and generalizations of the language. Our embedding translates ML5 into a slightly different logic: intuitionistic S5 extended with a lax modality that encapsulates effectful computations in a monad. Rather than formalizing lax S5 as a proof theory, we embed it as a universe within the the dependently typed host language, with the universe elimination given by implementing the modal logic’s Kripke semantics. 1
A Substructural Type System for Delimited Continuations ⋆
"... Abstract. We propose type systems that abstractly interpret small-step rather than big-step operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the opera ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Abstract. We propose type systems that abstractly interpret small-step rather than big-step operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational semantics, but also expressed by structural rules in the type system, so the types track control flow more closely. Binding and evaluation contexts are related, but the latter are linear. We use these ideas to build a type system for delimited continuations. It lets control operators change the answer type or act beyond the nearest dynamically-enclosing delimiter, yet needs no extra fields in judgments and arrow types to record answer types. The typing derivation of a directstyle program desugars it into continuation-passing style. 1
The different aspects of monads and mixins
, 2007
"... Around twenty years ago two important developments happened in the areas of modularity and reuse in programming languages. On the one hand, Moggi showed how computational effects found in impure languages could be simulated using the notion of monads from category theory. Inspired by Moggi’s work, W ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
Around twenty years ago two important developments happened in the areas of modularity and reuse in programming languages. On the one hand, Moggi showed how computational effects found in impure languages could be simulated using the notion of monads from category theory. Inspired by Moggi’s work, Wadler showed how monads could be used to structure (purely functional) programs. On the other hand, work by Cook showed how variations of mixins could model different notions of inheritance (normally found in object-oriented languages) in simple, elegant and compositional ways, by using traditional techniques of fixed-point theory. Monads and mixins are helpful to handle different aspects of modularity and reuse in programming languages, yet they have been largely explored independently. In this paper we show that the combination of monads and mixins leads to a simple aspectoriented programming (AOP) style that can be used effectively in purely functional programming languages to write elegant, reusable and modular programs.

