Abstract

Abstract Common approaches to concurrent programming begin with languages whose semantics are naturally sequential and add new constructs that provide limited access to concurrency, as exemplified by futures. This approach has been quite successful, but often does not provide a satisfactory theoretical backing for the concurrency constructs, and it can be difficult to give a good semantics that allows a programmer to use more than one of these constructs at a time. We take a different approach, starting with a concurrent language based on a Curry–Howard interpretation of adjoint logic, to which we add three atomic primitives that allow us to encode sequential composition and various forms of synchronization. The resulting language is highly expressive, allowing us to encode futures, fork/join parallelism, and monadic concurrency in the same framework. Notably, since our language is based on adjoint logic, we are able to give a formal account of linear futures, which have been used in complexity analysis by Blelloch and Reid-Miller. The uniformity of this approach means that we can similarly work with many of the other concurrency primitives in a linear fashion, and that we can mix several of these forms of concurrency in the same program to serve different purposes.

Highlights

  • Concurrency has been a very useful tool in increasing performance of computations and in enabling distributed computation, and there are a wide variety of different approaches to programming languages for concurrency

  • 3 Seax: Types and syntax The type system and language we present here, which we will use throughout this paper, begin with a Curry–Howard interpretation of adjoint logic, which we leave behind by adding recursion, allowing a richer collection of programs

  • For a different type of concurrency primitive, we look at a monad for concurrency, taking some inspiration from SILL (Toninho et al, 2013; Toninho, 2015; Griffith, 2016), which makes use of a contextual monad to embed the concurrency primitives of linear session types into a functional language

Read more

Summary

Introduction

Concurrency has been a very useful tool in increasing performance of computations and in enabling distributed computation, and there are a wide variety of different approaches to programming languages for concurrency. We add three new atomic write constructs that write a value and its tag in one step This minor addition enables us to encode both some forms of synchronization and sequential composition of processes, despite the naturally concurrent semantics of Seax. We begin by introducing the type system and syntax for Seax, along with some background on adjoint logic (Section 3), followed by its semantics, which are naturally concurrent (Section 4) At this point, we are able to look at some examples of programs in Seax. We conclude with a brief discussion of our results and future work

Adjoint logic
Concurrent semantics
Results
Example
Example: λ-Calculus
Sequential semantics
Functions
Futures
Monadic concurrency
10 Conclusion
Typed futures
Proofs of type correctness
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call