Interruptible context-dependent executions: a fresh look at programming context-aware applications

Context-aware applications provide end-users with enhanced experiences by continuously sensing their environment and adapting their behaviour to match the current context of use. However, developing true context-aware applications remains notoriously difficult due to the unpredictable nature of context changes. A context change may occur at any moment during a procedure execution, which may require an ongoing execution to be promptly interrupted in order to prevent the procedure from running in a wrong context. Currently, developers have to manually constrain a procedure execution to a particular context and take care of saving and restoring the execution state between context changes. Such manual approaches are error-prone and may lead to incorrect application behaviour. This paper presents a novel programming language model called interruptible context-dependent executions, where a procedure execution is always constrained to happen only under a specified context. In this model, a procedure execution can be seamlessly interrupted or resumed depending on the context. Additionally, the procedure execution state is automatically preserved between interruptions. We present the Flute language that supports interruptible context-dependent executions.

[1]  Robert Harper,et al.  Typing first-class continuations in ML , 1991, POPL '91.

[2]  Theo D'Hondt,et al.  Towards context-aware propagators: language constructs for context-aware adaptation dependencies , 2009, COP@ECOOP.

[3]  Hidehiko Masuhara,et al.  EventCJ: a context-oriented programming language with declarative event-based context transition , 2011, AOSD '11.

[4]  Kim Mens,et al.  Highly dynamic behaviour adaptability through prototypes with subjective multimethods , 2007, DLS '07.

[5]  Riccardo Pucella,et al.  Reactive programming in Standard ML , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[6]  Chris D. Marlin Coroutines: A Programming Methodology, a Language Design and an Implementation , 1980, Lecture Notes in Computer Science.

[7]  O. J. Dahl,et al.  Simula Begin , 1979 .

[8]  Roberto Ierusalimschy,et al.  Revisiting coroutines , 2009, TOPL.

[9]  Theo D'Hondt,et al.  Bringing Scheme programming to the iPhone—Experience , 2012, Softw. Pract. Exp..

[10]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[11]  Julie A. McCann,et al.  Adaptive middleware for context-aware applications in smart-homes , 2004, MPAC '04.

[12]  Éric Tanter Contextual values , 2008, DLS '08.

[13]  Shriram Krishnamurthi,et al.  Embedding Dynamic Dataflow in a Call-by-Value Language , 2006, ESOP.

[14]  Christopher Frost,et al.  Expressive and modular predicate dispatch for Java , 2009, TOPL.

[15]  Bradford Nichols,et al.  Pthreads programming , 1996 .

[16]  Michael Sperber,et al.  Developing a stage lighting system from scratch , 2001, ICFP '01.

[17]  R. Kent Dybvig,et al.  Revised6 Report on the Algorithmic Language Scheme , 2009 .

[18]  Kim Mens,et al.  Predicated generic functions: enabling context-dependent method dispatch , 2010 .

[19]  Yoshiki Ohshima,et al.  Worlds: Controlling the Scope of Side Effects , 2011, ECOOP.

[20]  Oscar Nierstrasz,et al.  Context-oriented Programming , 2008, J. Object Technol..

[21]  Matteo Pradella,et al.  Context-oriented programming: A software engineering perspective , 2012, J. Syst. Softw..

[22]  S. Dmitriev Language Oriented Programming: The Next Programming Paradigm , 2004 .

[23]  Mitchell Wand,et al.  Essentials of Programming Languages, 3rd Edition , 2008 .

[24]  Nir Shavit,et al.  Software transactional memory , 1995, PODC '95.

[25]  Craig S. Kaplan,et al.  Predicate Dispatching: A Unified Theory of Dispatch , 1998, ECOOP.

[26]  Robert Hirschfeld,et al.  Language Constructs for Context-oriented Programming , 2005 .

[27]  Mitchell Wand,et al.  Essentials of programming languages , 2008 .

[28]  Roberto Ierusalimschy,et al.  Coroutines in Lua , 2004 .

[29]  Paul Hudak,et al.  Functional reactive programming from first principles , 2000, PLDI '00.

[30]  Simon L. Peyton Jones,et al.  Composable memory transactions , 2005, CACM.

[31]  Cecilia Mascolo,et al.  Reflective Middleware Solutions for Context-Aware Applications , 2001, Reflection.

[32]  Robert Hirschfeld,et al.  Language constructs for context-oriented programming: an overview of ContextL , 2005, DLS '05.

[33]  Manuel Serrano,et al.  Scheme fair threads , 2004, PPDP '04.

[34]  Mitchell Wand,et al.  Obtaining Coroutines with Continuations , 1986, Comput. Lang..

[35]  Shriram Krishnamurthi,et al.  Flapjax: a programming language for Ajax applications , 2009, OOPSLA 2009.

[36]  Melvin E. Conway,et al.  Design of a separable transition-diagram compiler , 1963, CACM.