ARx: Reactive Programming for Synchronous Connectors Jos Proena , - - PowerPoint PPT Presentation

arx reactive programming for synchronous connectors
SMART_READER_LITE
LIVE PREVIEW

ARx: Reactive Programming for Synchronous Connectors Jos Proena , - - PowerPoint PPT Presentation

ARx: Reactive Programming for Synchronous Connectors Jos Proena , Guillermina Cledou Coordination @ DisCoTec 2020 Video of the presentation: https://www.youtube.com/watch?v=74RUzfYneNI&t=2s Tools: http://arcatools.org/#arx Tools:


slide-1
SLIDE 1

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

ARx: Reactive Programming for Synchronous Connectors

José Proença, Guillermina Cledou

Coordination @ DisCoTec 2020

Video of the presentation: https://www.youtube.com/watch?v=74RUzfYneNI&t=2s

slide-2
SLIDE 2

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

compiled to

Scala

arcatools.org/#arx

JavaScript

slide-3
SLIDE 3

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

arcatools.org/#arx

Syntax

  • Constructs
  • Layout

Motivation

  • Reactive

Languages

  • Synchronous

Languages Semantics

  • Stream

Builders

  • Reactive

Interpretation

slide-4
SLIDE 4

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Syntax

lossy(a) fifo(a) drain(a,b) c <– a c <– b b <– a c <– a a <~ b Data Bool = True | False

Reo-based constructs Reactive Variables Algebraic data types

slide-5
SLIDE 5

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Synchronous connectors

a and b at the same time 1. get b 2. block b until empty 3. sent to o

drain(a,b)

  • <– a
  • <– fifo(b)
  • Either
  • get a
  • get b

E.g., Reo, Lustre, Esterel

( )

slide-6
SLIDE 6

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Programs (1)

... c <– Times(a,b) Plus(a,c)

From: E. Bainomugisha, A.L. Carreton, T. van Cutsem, S. Mostinckx, and W. de

  • Meuter. A survey on reactive programming. ACM Comput. Surv., 2013.

Reactive variables Triggered if b is updated Triggered if both a and c are updated

E.g., Angular, Yampa, ReScala

( )

slide-7
SLIDE 7

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Programs (2)

Domain: Graphical users interfaces constantly updated sometimes updated May request updated values Dynamic dependencies

if sel then mouse else time

E.g., Angular, Yampa, ReScala

( )

slide-8
SLIDE 8

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Programs (2)

Domain: Graphical users interfaces constantly updated sometimes updated May request updated values Dynamic dependencies

if sel then mouse else time

E.g., Angular, Yampa, ReScala

( )

selRx <~ sel true,false <– match(selRx) ...

slide-9
SLIDE 9

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Programs (2)

Domain: Graphical users interfaces constantly updated sometimes updated May request updated values Dynamic dependencies

if sel then mouse else time data Bool = True | False selRx <~ sel true,false <– match(selRx) ...

E.g., Angular, Yampa, ReScala

( )

slide-10
SLIDE 10

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Semantics

ARx Semantics via stream builders Types Automata semantics of stream builders

slide-11
SLIDE 11

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Stream Builder

Set of exclusive guarded commands guards updates how to consume input/memory streams how to write output/memory streams

Semantics with composition

x

slide-12
SLIDE 12

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Stream Builder

get destructive read und undefined value ...

slide-13
SLIDE 13

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Compact representation

Stream Builder

(no state explosion) Based on stream constraints

[Dokter and Arbab ’18] Dokter and Arbab. Rule-based form for stream constraints Coordination Models and Languages, 2018

slide-14
SLIDE 14

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactiveness

Stream Builder

b a

ask non-destructive read latest value always available

slide-15
SLIDE 15

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Examples

b a b a

b always available m0 overwritten b only once m0 NOT overwritten

slide-16
SLIDE 16

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Semantics

The environment controls when to read (pull) / write (push)

Push-pull interpretation

Triggered if a is updated Triggered if a is updated Or if a is active and the environment wants to read b

b a

slide-17
SLIDE 17

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Reactive Semantics

Push-pull interpretation

via stream builder automata

slide-18
SLIDE 18

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Wrap up

Synchronous + Reactive DSL ADTs Scala + Javascript

slide-19
SLIDE 19

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Wrap up

Reactive Semantics for SB (with push-pull interpretation) Synchronous + Reactive DSL Stream builder Semantics ADTs Type Analysis Scala + Javascript

slide-20
SLIDE 20

Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx

Architectural view Reactive Semantics for SB (with push-pull interpretation)

Wrap up

Synchronous + Reactive DSL Stream builder Semantics ADTs Type Analysis Scala + Javascript