Use this URL to cite or link to this record in EThOS: http://ethos.bl.uk/OrderDetails.do?uin=uk.bl.ethos.656484
Title: Context-oriented functional programming
Author: Martins, Pedro M.
Awarding Body: Imperial College London
Current Institution: Imperial College London
Date of Award: 2013
Availability of Full Text:
Access from EThOS:
Full text unavailable from EThOS. Please try the link below.
Access from Institution:
Abstract:
The modern computing landscape, featuring heterogeneous interconnected mobile devices, poses new challenges and opportunities for application development. Mobility and heterogeneity of devices imply that applications need to adapt depending on their execution context. Contexts such as the device that an application is running on, or the power profile, may require widespread program-wide adaptation. Dealing with this adaptation can lead to the introduction of subtle bugs, and subsequent runtime errors, such as null pointer exceptions when context has not been initialized. Current approaches to encoding context-aware behaviour are either very flexible but unsafe, or safe but too restrictive. In this thesis we present a new approach to context-aware application development based on functional programming, which attempts to be both flexible and safe. In order to do so, we present an embedded domain specific language in Haskell, where we explore the design space of context-dependent values within a functional programming language. In particular, we explore how to use Haskell's type system to automatically derive the context dependencies needed by a computation at the type level, and use this to ensure that required context is always available. We then develop context-dependent types to ensure safety in the presence of program-wide variation. By using different return types for different modes of operation of the program when appropriate, we can ensure isolation between them through type checking. We extend our domain specific language to support context-dependent types, whilst retaining type soundness, as well as sound and (we conjecture) complete type inference. We present a core calculus for these features and a high-level language that extends the calculus with practical programming features. Evaluation is performed by examining a context-aware application requiring exactly the kind of adaptation that is unsafe to implement in current approaches. We show that our language compares favourably to the state of the art in terms of both safety and code clarity.
Supervisor: McCann, Julie Sponsor: Fundacao para a Ciencia e a Tecnologia
Qualification Name: Thesis (Ph.D.) Qualification Level: Doctoral
EThOS ID: uk.bl.ethos.656484  DOI: Not available
Share: