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 Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
arcatools.org/#arx Scala compiled to JavaScript 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 Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Syntax Reo-based Reactive constructs Variables lossy (a) a <~ b fifo (a) drain (a,b) Algebraic data c <– a types c <– b Data Bool = b <– a True | False c <– a Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Synchronous connectors Either ( ) E.g., Reo , get a ● Lustre, Esterel get b ● drain (a,b) a and b o <– a at the same time o <– fifo (b) o 1. get b 2. block b until empty 3. sent to o Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Programs (1) ( ) E.g., Angular, Yampa, ReScala ... Reactive c <– Times (a,b) variables Plus (a,c) Triggered if Triggered if both a and c b is updated are updated From: E. Bainomugisha, A.L. Carreton, T. van Cutsem, S. Mostinckx, and W. de Meuter. A survey on reactive programming . ACM Comput. Surv., 2013. Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Programs (2) Domain: Graphical ( ) E.g., Angular, users interfaces Yampa, ReScala constantly sometimes updated updated Dynamic May request dependencies updated values if sel then mouse else time Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Programs (2) Domain: Graphical ( ) E.g., Angular, users interfaces Yampa, ReScala constantly sometimes updated updated selRx <~ sel true,false <– Dynamic match (selRx) May request dependencies ... updated values if sel then mouse else time Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Programs (2) Domain: Graphical ( ) E.g., Angular, users interfaces Yampa, ReScala constantly sometimes updated updated data Bool = True | False selRx <~ sel true,false <– Dynamic match (selRx) May request dependencies ... updated values if sel then mouse else time Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Semantics Automata semantics of stream builders Types ARx Semantics via stream builders Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Stream Builder Semantics with composition Set of exclusive guarded commands guards how to consume input/memory streams x updates how to write output/memory streams Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Stream Builder get destructive read und undefined value ... Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Stream Builder Compact representation (no state explosion) Based on stream constraints [Dokter and Arbab ’18] Dokter and Arbab. Rule-based form for stream constraints Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx Coordination Models and Languages, 2018
Stream Builder Reactiveness latest value always available a b ask non-destructive read Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Examples a b b always available m0 overwritten a b b only once m0 NOT overwritten Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Semantics Push-pull interpretation Triggered if a b a is updated Or if a is active and the environment wants to read b Triggered if a is updated The environment controls when to read (pull) / write (push) Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Reactive Semantics via stream builder Push-pull interpretation automata Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Wrap up Synchronous + Reactive DSL Scala + Javascript ADTs Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Wrap up Synchronous + Reactive DSL Type Analysis Scala + Javascript ADTs Stream builder Semantics Reactive Semantics for SB (with push-pull interpretation) Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Wrap up Synchronous + Reactive DSL Type Analysis Scala + Javascript ADTs Stream builder Semantics Reactive Semantics for SB (with push-pull interpretation) Architectural view Tools: http://arcatools.org/#arx Tools: http://arcatools.org/#arx
Recommend
More recommend