A Direct-Style Effect Notation for Sequential and Parallel Programs

05/15/2023
by   David Richter, et al.
0

Modeling sequential and parallel composition of effectful computations has been investigated in a variety of languages for a long time. In particular, the popular do-notation provides a lightweight effect embedding for any instance of a monad. Idiom bracket notation, on the other hand, provides an embedding for applicatives. First, while monads force effects to be executed sequentially, ignoring potential for parallelism, applicatives do not support sequential effects. Composing sequential with parallel effects remains an open problem. This is even more of an issue as real programs consist of a combination of both sequential and parallel segments. Second, common notations do not support invoking effects in direct-style, instead forcing a rigid structure upon the code. In this paper, we propose a mixed applicative/monadic notation that retains parallelism where possible, but allows sequentiality where necessary. We leverage a direct-style notation where sequentiality or parallelism is derived from the structure of the code. We provide a mechanisation of our effectful language in Coq and prove that our compilation approach retains the parallelism of the source program.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/29/2021

Disentangling Parallelism and Interference in Game Semantics

Game semantics is a denotational semantics presenting compositionally th...
research
07/08/2019

Parallelism Theorem and Derived Rules for Parallel Coherent Transformations

An Independent Parallelism Theorem is proven in the theory of adhesive H...
research
01/07/2018

Arrows for Parallel Computation

Arrows are a general interface for computation and an alternative to Mon...
research
07/01/2021

Efficient Tree-Traversals: Reconciling Parallelism and Dense Data Representations

Recent work showed that compiling functional programs to use dense, seri...
research
12/09/2022

Parallelism detection using graph labelling

Usage of multiprocessor and multicore computers implies parallel program...
research
08/06/2018

Polymorphic Iterable Sequential Effect Systems

Effect systems are lightweight extensions to type systems that can verif...
research
02/10/2023

Evaluating the Performance of Speculative DOACROSS Loop Parallelization with taskloop

OpenMP provides programmers with directives to parallelize DOALL loops s...

Please sign up or login with your details

Forgot password? Click here to reset