Results 1  10
of
11
Ultrametric Semantics of Reactive Programs
"... Abstract—We describe a denotational model of higherorder functional reactive programming using ultrametric spaces and nonexpansive maps, which provide a natural Cartesian closed generalization of causal stream functions and guarded recursive definitions. We define a type theory corresponding to thi ..."
Abstract

Cited by 9 (3 self)
 Add to MetaCart
(Show Context)
Abstract—We describe a denotational model of higherorder functional reactive programming using ultrametric spaces and nonexpansive maps, which provide a natural Cartesian closed generalization of causal stream functions and guarded recursive definitions. We define a type theory corresponding to this semantics and show that it satisfies normalization. Finally, we show how reactive programs written in this language may be implemented efficiently using an imperatively updated dataflow graph, and give a separation logic proof that this lowlevel implementation is correct with respect to the highlevel semantics. I.
A Semantic Model for Graphical User Interfaces
, 2011
"... We give a denotational model for graphical user interface (GUI) programming in terms of the cartesian closed category of ultrametric spaces. The metric structure allows us to capture natural restrictions on reactive systems, such as causality, while still allowing recursively defined values. We capt ..."
Abstract

Cited by 8 (1 self)
 Add to MetaCart
(Show Context)
We give a denotational model for graphical user interface (GUI) programming in terms of the cartesian closed category of ultrametric spaces. The metric structure allows us to capture natural restrictions on reactive systems, such as causality, while still allowing recursively defined values. We capture the arbitrariness of user input (e.g., a user gets to decide the stream of clicks she sends to a program) by making use of the fact that the closed subsets of a metric space themselves form a metric space under the Hausdorff metric, allowing us to interpret nondeterminism with a “powerspace ” monad on ultrametric spaces. The powerspace monad is commutative, and hence gives rise to a model of linear logic. We exploit this fact by constructing a mixed linear/nonlinear domainspecific language for GUI programming. The linear sublanguage naturally captures the usage constraints on the various linear objects in GUIs, such as the elements of a DOM or scene graph. We have implemented this DSL as an extension to OCaml, and give examples demonstrating that programs in this style can be short and readable.
Run Your Research On the Effectiveness of Lightweight Mechanization
"... Formal models serve in many roles in the programming language community. In its primary role, a model communicates the idea of a language design; the architecture of a language tool; or the essence of a program analysis. No matter which role it plays, however, a faulty model doesn’t serve its purpos ..."
Abstract

Cited by 8 (0 self)
 Add to MetaCart
Formal models serve in many roles in the programming language community. In its primary role, a model communicates the idea of a language design; the architecture of a language tool; or the essence of a program analysis. No matter which role it plays, however, a faulty model doesn’t serve its purpose. One way to eliminate flaws from a model is to write it down in a mechanized formal language. It is then possible to state theorems about the model, to prove them, and to check the proofs. Over the past nine years, PLT has developed and explored a lightweight version of this approach, dubbed Redex. In a nutshell, Redex is a domainspecific language for semantic models that is embedded in the Racket programming language. The effort of creating a model in Redex is often no more burdensome than typesetting it with LaTeX; the difference is that Redex comes with tools for the semantics engineering life cycle. In this paper we report on a validation of this form of lightweight mechanization. The largest part of this validation concerns the formalization and exploration of nine ICFP 2009 papers in Redex, an effort that uncovered mistakes in all nine papers. The results suggest that Redexbased lightweight modeling is effective and easy to integrate into the work flow of a semantics engineer. This experience also suggests lessons for the developers of other mechanization tools.
HigherOrder Functional Reactive Programming in Bounded Space
"... Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
(Show Context)
Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to predict. In this paper, we address the problem of space leaks in discretetime functional reactive programs. We present a functional reactive programming language that statically bounds the size of the dataflow graph a reactive program creates, while still permitting use of higherorder functions and highertype streams such as streams of streams. We achieve this with a novel linear type theory that both controls allocation and ensures that all recursive definitions are wellfounded. We also give a denotational semantics for our language by combining recent work on metric spaces for the interpretation of higherorder causal functions with lengthspace models of spacebounded computation. The resulting category is doubly closed and hence forms a model of the logic of bunched implications.
Efficient and Compositional HigherOrder Streams
"... Abstract. Streambased programming has been around for a long time, but it is typically restricted to static dataflow networks. By introducing firstclass streams that implement the monad interface, we can describe arbitrary dynamic networks in an elegant and consistent way using only two extra pri ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
Abstract. Streambased programming has been around for a long time, but it is typically restricted to static dataflow networks. By introducing firstclass streams that implement the monad interface, we can describe arbitrary dynamic networks in an elegant and consistent way using only two extra primitives besides the monadic operations. This paper presents an efficient stream implementation and demonstrates the compositionality of the constructs by mapping them to functions over natural numbers. 1
An Ultrametric Model of Reactive Programming
, 2010
"... We describe a denotational model of higherorder functional reactive programming using ultrametric spaces, which provide a natural Cartesian closed generalization of causal stream functions. We define a domainspecific language corresponding to the model. We then show how reactive programs written i ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
We describe a denotational model of higherorder functional reactive programming using ultrametric spaces, which provide a natural Cartesian closed generalization of causal stream functions. We define a domainspecific language corresponding to the model. We then show how reactive programs written in this language may be implemented efficiently using an imperatively updated dataflow graph and give a higherorder separation logic proof that this lowlevel implementation is correct with respect to the highlevel semantics.
Combinators for MessagePassing in Haskell
"... Abstract. Much code in messagepassing programs is tedious, verbose wiring code. This code is error prone and laborious – and tends to be repeated across many programs with only slight variations. By using typeclasses, higherorder and monadic functions in Haskell, most of this code can be captured ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
Abstract. Much code in messagepassing programs is tedious, verbose wiring code. This code is error prone and laborious – and tends to be repeated across many programs with only slight variations. By using typeclasses, higherorder and monadic functions in Haskell, most of this code can be captured in reusable highlevel combinators that shorten and simplify messagepassing programs. We motivate the design and use of these combinators via an example of a concurrent biological simulation, and explain their implementation in the Communicating Haskell Processes library. 1
Virtualizing RealWorld Objects in FRP
, 2011
"... We begin with a functional reactive programming (FRP) model in which every program is viewed as a signal function that converts a stream of input values into a stream of output values. We observe that objects in the real world – such as a keyboard or sound card – can be thought of as signal function ..."
Abstract
 Add to MetaCart
(Show Context)
We begin with a functional reactive programming (FRP) model in which every program is viewed as a signal function that converts a stream of input values into a stream of output values. We observe that objects in the real world – such as a keyboard or sound card – can be thought of as signal functions as well. This leads us to a radically different approach to I/O – instead of treating realworld objects as being external to the program, we expand the sphere of influence of program execution to include them within the program. We call this virtualizing realworld objects. We explore how even virtual objects, such as GUI widgets, and nonlocal effects, such as are needed for debugging (using something that we call a “wormhole”) and random number generation, can be handled in the same way. Our methodology may at first seem naïve – one may ask how we prevent a virtualized device from being copied, thus potentially introducing nondeterminism as one part of a program competes for the same resource as another. To solve this problem, we introduce the notion of a resource type that assures that a virtualized object is not duplicated and that I/Oandnonlocaleffectsaresafe. Resourcetypesalsoprovideadeeperleveloftransparency:
Simple and Efficient HigherOrder Reactive Programming
, 2012
"... Functional reactive programming (FRP) is an elegant approach to declaratively specify reactive systems. However, the powerful abstractions of FRP have historically made it difficult to predict and control the resource usage of programs written in this style. In this paper we give a simple type theor ..."
Abstract
 Add to MetaCart
Functional reactive programming (FRP) is an elegant approach to declaratively specify reactive systems. However, the powerful abstractions of FRP have historically made it difficult to predict and control the resource usage of programs written in this style. In this paper we give a simple type theory for higherorder functional reactive programming, as well as a natural implementation strategy for it. Our type theory simplifies and generalizes prior type systems for reactive programming. At the same time, we give a an efficient implementation strategy which eagerly deallocates old values, ruling out space and time leaks, two notorious sources of inefficiency in reactive programs. Our language neither restricts the expressive power of the FRP model, nor does it require a complex substructural type system to track the resource usage of programs. We also show that for programs welltyped under our type system, our implementation strategy of eager deallocation is safe: we show the soundness of our type system under our implementation strategy, using a novel stepindexed Kripke logical relation.
Under consideration for publication in J. Functional Programming 1 Implicit selfadjusting computation
, 2014
"... Computational problems that involve dynamic data, such as physics simulations and program development environments, have been an important subject of study in programming languages. Building on this work, recent advances in selfadjusting computation have developed techniques that enable programs to ..."
Abstract
 Add to MetaCart
(Show Context)
Computational problems that involve dynamic data, such as physics simulations and program development environments, have been an important subject of study in programming languages. Building on this work, recent advances in selfadjusting computation have developed techniques that enable programs to respond automatically and efficiently to dynamic changes in their inputs. Selfadjusting programs have been shown to be efficient for a reasonably broad range of problems but the approach still requires an explicit programming style, where the programmer must use specific monadic types and primitives to identify, create and operate on data that can change over time. We describe techniques for automatically translating purely functional programs into selfadjusting programs. In this implicit approach, the programmer need only annotate the (toplevel) input types of the programs to be translated. Type inference finds all other types, and a typedirected translation rewrites the source program into an explicitly selfadjusting target program. The type system is related to informationflow type systems and enjoys decidable type inference via constraint solving. We prove that the translation outputs welltyped selfadjusting programs and preserves the source program’s inputoutput behavior, guaranteeing that translated programs respond correctly to all changes to their data. Using a cost semantics, we also prove that the translation preserves the asymptotic complexity of the source program. 1