The Network as a Language Construct Tony Garnock-Jones Sam - - PowerPoint PPT Presentation

the network as a language construct
SMART_READER_LITE
LIVE PREVIEW

The Network as a Language Construct Tony Garnock-Jones Sam - - PowerPoint PPT Presentation

ESOP 2014, Grenoble, France; 20140410 The Network as a Language Construct Tony Garnock-Jones Sam Tobin-Hochstadt Matthias Felleisen Actor Programming Languages Erlang/OTP, Scala/Akka, ... ? ? ? Actor Programming Languages Erlang/OTP,


slide-1
SLIDE 1

ESOP 2014, Grenoble, France; 20140410

The Network as a Language Construct

Tony Garnock-Jones Sam Tobin-Hochstadt Matthias Felleisen

slide-2
SLIDE 2

Actor Programming Languages

Erlang/OTP, Scala/Akka, ...

slide-3
SLIDE 3

? ? ?

Actor Programming Languages

Erlang/OTP, Scala/Akka, ...

slide-4
SLIDE 4

Routing Events Hierarchical Layering Publish/Subscribe for Actors Actor Programming Languages

Erlang/OTP, Scala/Akka, ...

slide-5
SLIDE 5

This Talk Routing Events Hierarchical Layering Publish/Subscribe for Actors Actor Programming Languages

Erlang/OTP, Scala/Akka, ...

See Paper Network Calculus Actor Calculus

slide-6
SLIDE 6

PART I: The Problem

slide-7
SLIDE 7

Functional I/O

Scaling up big-bang from domain-specific to general functional I/O

slide-8
SLIDE 8

Functional I/O

Scaling up big-bang from domain-specific to general functional I/O Apps in a functional I/O style:

  • echo server
  • multi-user chat
  • DNS server
  • SSH server
slide-9
SLIDE 9

Functional I/O Distributed Systems

Scaling up big-bang from domain-specific to general functional I/O Implementing RabbitMQ and using it to build distributed systems Apps in a functional I/O style:

  • echo server
  • multi-user chat
  • DNS server
  • SSH server
slide-10
SLIDE 10

Functional I/O Distributed Systems

Scaling up big-bang from domain-specific to general functional I/O Implementing RabbitMQ and using it to build distributed systems Apps in a functional I/O style:

  • echo server
  • multi-user chat
  • DNS server
  • SSH server

Investigated other paradigms:

  • OO languages
  • Network architecture
  • CORBA services
  • Erlang applications
slide-11
SLIDE 11

Ubiquitous Patterns and Problems

Event broadcasting Naming service Service discovery Startup ordering Crash/exit signalling Conversation management

slide-12
SLIDE 12

Ubiquitous Patterns and Problems

Event broadcasting Naming service Service discovery Startup ordering Crash/exit signalling Conversation management

Uniform Linguistic Solution

slide-13
SLIDE 13

Recipe for Actor Languages

Base language actor "Network"

slide-14
SLIDE 14

Consumers filter by subsystem, severity

slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20

Logging: Requirements Scorecard

Route log entries from producers to consumers Consumers filter log messages Decouple producers from consumers Avoid shared-state explosion Discovery of logging service Only produce if someone's listening Alert when a producer crashes/exits Uniform treatment of I/O

slide-21
SLIDE 21

PART II: Why Publish/Subscribe? How?

slide-22
SLIDE 22
slide-23
SLIDE 23

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔"Router" actor Consumers filter log messages ✔"Router" actor Decouple producers from consumers ✔"Router" actor Avoid shared-state explosion ✔"Router" actor Discovery of logging service Only produce if someone's listening Alert when a producer crashes/exits Uniform treatment of I/O

slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26

See Eugster's 2003 pub/sub survey

slide-27
SLIDE 27

Route by address

Messages

slide-28
SLIDE 28

Route by address Route by content

Messages Patterns Interests

slide-29
SLIDE 29

Route by address Route by content

  • r
  • r
  • r
slide-30
SLIDE 30

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔pub/sub Consumers filter log messages ✔pub/sub Decouple producers from consumers ✔pub/sub Avoid shared-state explosion ✔pub/sub Discovery of logging service no need! Only produce if someone's listening Alert when a producer crashes/exits Uniform treatment of I/O ✔pub/sub

slide-31
SLIDE 31

PART III: Why Routing Events? How?

slide-32
SLIDE 32

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔ Consumers filter log messages ✔ Decouple producers from consumers ✔ Avoid shared-state explosion ✔ Discovery of logging service Only produce if someone's listening Alert when a producer crashes/exits Uniform treatment of I/O ✔

slide-33
SLIDE 33

Shared Conversational Interest

slide-34
SLIDE 34

Shared Conversational Interest

slide-35
SLIDE 35

Shared Conversational Interest

slide-36
SLIDE 36

Shared Conversational Interest

slide-37
SLIDE 37

Shared Conversational Interest

Any pattern language will do — if it supports ∩

slide-38
SLIDE 38

What is a Routing Event?

slide-39
SLIDE 39

What is a Routing Event?

From Actor to Network

slide-40
SLIDE 40

What is a Routing Event?

From Actor to Network

slide-41
SLIDE 41

What is a Routing Event?

causes From Actor to Network From Network to Actor

slide-42
SLIDE 42

Routing Events for Service Discovery

slide-43
SLIDE 43

Routing Events for Service Discovery

slide-44
SLIDE 44

Routing Events for Service Discovery

slide-45
SLIDE 45

Routing Events for Service Discovery

slide-46
SLIDE 46

Routing Events for Service Discovery

slide-47
SLIDE 47

Routing Events for Service Discovery

slide-48
SLIDE 48

Routing Events for Service Discovery

slide-49
SLIDE 49

Routing Events for Service Discovery

slide-50
SLIDE 50

Routing Events for Service Discovery

slide-51
SLIDE 51

Routing Events for Presence Detection

slide-52
SLIDE 52

Routing Events for Presence Detection

slide-53
SLIDE 53

Routing Events for Presence Detection

slide-54
SLIDE 54

Routing Events for Presence Detection

slide-55
SLIDE 55

Routing Events for Presence Detection

slide-56
SLIDE 56

Routing Events for Presence Detection

slide-57
SLIDE 57

Routing Events for Presence Detection

slide-58
SLIDE 58

Routing Events for Presence Detection

slide-59
SLIDE 59

Routing Events for Presence Detection

slide-60
SLIDE 60

Routing Events for Presence Detection

slide-61
SLIDE 61

Routing Events for Crash Detection

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-62
SLIDE 62

Routing Events for Crash Detection

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-63
SLIDE 63

Routing Events for Crash Detection

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-64
SLIDE 64

Routing Events for Crash Detection

!

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-65
SLIDE 65

Routing Events for Crash Detection

!

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-66
SLIDE 66

Routing Events for Crash Detection

!

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-67
SLIDE 67

Routing Events for Crash Detection

!

pager

  • cf. Erlang's links/monitors [Armstrong 2003]
slide-68
SLIDE 68

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔pub/sub Consumers filter log messages ✔pub/sub Decouple producers from consumers ✔pub/sub Avoid shared-state explosion ✔pub/sub Discovery of logging service ✔routing events Only produce if someone's listening ✔routing events Alert when a producer crashes/exits ✔routing events Uniform treatment of I/O ✔pub/sub

slide-69
SLIDE 69

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔pub/sub Consumers filter log messages ✔pub/sub Decouple producers from consumers ✔pub/sub Avoid shared-state explosion ✔pub/sub Discovery of logging service ✔routing events Only produce if someone's listening ✔routing events Alert when a producer crashes/exits ✔routing events Uniform treatment of I/O not finished!

slide-70
SLIDE 70

PART IV: Why Hierarchical Layering? How?

slide-71
SLIDE 71

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔ Consumers filter log messages ✔ Decouple producers from consumers ✔ Avoid shared-state explosion ✔ Discovery of logging service ✔ Only produce if someone's listening ✔ Alert when a producer crashes/exits ✔ Uniform treatment of I/O not finished!

slide-72
SLIDE 72

Layers make I/O Uniform

Logging

pager m a g i c !

slide-73
SLIDE 73

Layers make I/O Uniform

Logging

pager m a g i c !

  • rdinary

actions

Logging

pager

Pager communication

slide-74
SLIDE 74

Layers make I/O Uniform

Logging

pager m a g i c !

  • rdinary

actions

Logging

pager

Pager communication

slide-75
SLIDE 75

Layers Scope Conversations

slide-76
SLIDE 76

Layers Scope Conversations

slide-77
SLIDE 77

Layers Scope Conversations

slide-78
SLIDE 78

Layers Compose

... ...

slide-79
SLIDE 79

Layers Compose

... ...

slide-80
SLIDE 80

Layers Compose

... ...

slide-81
SLIDE 81

One Layer = One Protocol

... ... ... ...

slide-82
SLIDE 82

One Layer = One Protocol

... ... ... ...

TCP header Encrypted payload SSH command App message

slide-83
SLIDE 83

One Layer = One Protocol

... ...

UDP header DNS header Question Answer Answer ...

slide-84
SLIDE 84

One Layer = One Protocol

Snoops via pub/sub to populate cache!

... ...

UDP header DNS header Question Answer Answer ...

slide-85
SLIDE 85
slide-86
SLIDE 86
slide-87
SLIDE 87
slide-88
SLIDE 88

...

slide-89
SLIDE 89

...

slide-90
SLIDE 90

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔pub/sub Consumers filter log messages ✔pub/sub Decouple producers from consumers ✔pub/sub Avoid shared-state explosion ✔pub/sub Discovery of logging service ✔routing events Only produce if someone's listening ✔routing events Alert when a producer crashes/exits ✔routing events Uniform treatment of I/O ✔layering

slide-91
SLIDE 91

Logging: Requirements Scorecard

Route log entries from producers to consumers ✔pub/sub Consumers filter log messages ✔pub/sub Decouple producers from consumers ✔pub/sub Avoid shared-state explosion ✔pub/sub Discovery of logging service ✔routing events Only produce if someone's listening ✔routing events Alert when a producer crashes/exits ✔routing events Uniform treatment of I/O ✔layering + great additional benefits from layering ✔

slide-92
SLIDE 92

PART V: Conclusions

slide-93
SLIDE 93

Marketplace Minimart JS-Marketplace

Typed Racket Racket Javascript

slide-94
SLIDE 94

Marketplace Minimart JS-Marketplace

Typed Racket Racket Javascript DNS server (UDP) SSH server (TCP) Chat server Echo server Websocket driver Generic msg broker Websocket driver DOM driver jQuery driver Chat + roster GUI composition

slide-95
SLIDE 95

Marketplace Minimart JS-Marketplace

Typed Racket Racket Javascript DNS server (UDP) SSH server (TCP) Chat server Echo server Websocket driver Generic msg broker Websocket driver DOM driver jQuery driver Chat + roster GUI composition Details and experience report in the paper!

slide-96
SLIDE 96

Actor Programming Language + Publish/Subscribe + Routing Events + Hierarchical Layering

Network Calculus Actor Calculus (see paper) Experience reports (see paper)

slide-97
SLIDE 97

Actor Programming Language + Publish/Subscribe + Routing Events + Hierarchical Layering

Thank you!

Network Calculus Actor Calculus (see paper) Experience reports (see paper) http://www.ccs.neu.edu/home/tonyg/marketplace/