how can we organise our interactive programs how can we
play

How can we organise our interactive programs? How can we organise - PowerPoint PPT Presentation

ESOP 2016, Eindhoven, Netherlands; 20160405 Coordinated Concurrent Programming in S YNDICATE Tony Garnock-Jones Matthias Felleisen tonyg@ccs.neu.edu matthias@ccs.neu.edu Northeastern University Northeastern University How can we organise


  1. ESOP 2016, Eindhoven, Netherlands; 20160405 Coordinated Concurrent Programming in S YNDICATE Tony Garnock-Jones ✉ Matthias Felleisen tonyg@ccs.neu.edu matthias@ccs.neu.edu Northeastern University Northeastern University

  2. How can we organise our interactive programs?

  3. How can we organise our interactive programs? With a programming language!

  4. How can we organise our interactive programs? S YNDICATE

  5. Program User Interactive System

  6. Program User External Concurrency

  7. Program User Lots of External Concurrency

  8. Program User Lots of External Concurrency Internal Organisation Re fl ects External Concurrency

  9. Program with coordination + internal tasks User Lots of External Concurrency Internal Organisation Re fl ects External Concurrency

  10. A A B B Networked C C Program D D with coordination + internal tasks Lots of External Concurrency Internal Organisation Re fl ects External Concurrency

  11. A A B B Networked C C Program D D with coordination + internal tasks E Lots of Dynamic, External Concurrency Component startup → interaction → shutdown/failure

  12. A A B B Networked C C Program D D with coordination + internal tasks E E Lots of Dynamic, External Concurrency Component startup → interaction → shutdown/failure

  13. A A B B Networked C C Program D D with coordination + internal tasks E E Lots of Dynamic, External Concurrency Component startup → interaction → shutdown/failure

  14. A A B Networked C C Program D D with coordination + internal tasks E E Lots of Dynamic, External Concurrency Component startup → interaction → shutdown/failure

  15. A A Networked C C Program D D with coordination + internal tasks E E Lots of Dynamic, External Concurrency Component startup → interaction → shutdown/failure

  16. S YNDICATE

  17. event × state → [action] × state

  18. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42

  19. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 Actor behaviour function private state unique internal ID

  20. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 cf. Linda's Dataspace: assertions + provenance “Tuplespaces”

  21. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 “I, actor #17, assert that the current score is 3.”

  22. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 “I, actor #42, assert that the space key is currently held down.”

  23. event × state → [action] × state Actions carry assertions actor → environment actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42

  24. event × state → [action] × state Events carry assertions environment → actor actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42

  25. event × state → [action] × state { [sprite,player,51,100, ], ?[keyDown, ★ ] } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42

  26. event × state → [action] × state { [sprite,player,51,100, ], ?[keyDown, ★ ] } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  27. event × state → [action] × state actor actor actor “I, actor #94, am interested in keeping track #17 #42 #94 of assertions of the form [keyDown, ★ ] .” [currentScore,3] → actor #17 [keyDown,space] → actor #42 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  28. event × state → [action] × state { [keyDown,space] } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  29. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  30. event × state → [action] × state { } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 [keyDown,space] → actor #42 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  31. event × state → [action] × state { } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 actor #42 [keyDown,space] ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  32. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  33. event × state → [action] × state { } actor actor actor #17 #42 #94 [currentScore,3] → actor #17 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  34. event × state → [action] × state actor actor actor #17 #42 #94 [currentScore,3] → actor #17 ] → actor #94 [sprite,player,51,100, ?[keyDown, ★ ] → actor #94

  35. actor #1 actor #42 ⟵ actor #99 [keyDown,space] → actor #42

  36. { ? ⇃ [keyDown, ★ ], ⇃ ?[keyDown, ★ ] } actor #1 actor #42 ⟵ actor #99 [keyDown,space] → actor #42

  37. { ? ⇃ [keyDown, ★ ], ⇃ ?[keyDown, ★ ] } actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42

  38. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 “I, actor #1, assert that I am interested in all key-down assertions [keyDown,space] → actor #42 at the next level out. ”

  39. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 “I, actor #1, request my dataspace to [keyDown,space] → actor #42 assert ‘interest in all key-down assertions’ on my behalf at the next level out.”

  40. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42

  41. actor #1 { ?[keyDown, ★ ] } ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42

  42. actor #1 { ?[keyDown, ★ ] } ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  43. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  44. actor #1 { [keyDown,space] } ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  45. actor #1 { [keyDown,space] } ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor ⇃ [keyDown,space] → ⇃ #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  46. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor ⇃ [keyDown,space] → ⇃ #99 [keyDown,space] → actor #42 “The next level out has informed us ?[keyDown, ★ ] → actor #99 that the space key is being held down.”

  47. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor ⇃ [keyDown,space] → ⇃ #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  48. { ⇃ [keyDown,space] } actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor ⇃ [keyDown,space] → ⇃ #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  49. actor #1 ? ⇃ [keyDown, ★ ] → actor #1 actor ⇃ ?[keyDown, ★ ] → actor #1 #42 ⟵ actor ⇃ [keyDown,space] → ⇃ #99 [keyDown,space] → actor #42 ?[keyDown, ★ ] → actor #99

  50. Messages are transient assertions < [incrementScoreBy,3] > ~ { [incrementScoreBy,3] } followed by { }

  51. General challenges of interactivity • Mapping events to components • Building a shared understanding • Partial failure • Scoped conversational state

  52. General challenges of interactivity • Mapping events to components • Building a shared understanding • Partial failure • Scoped conversational state

  53. Mapping events to components: OO

  54. Mapping events to components: Actors

  55. Mapping events to components: Syndicate

  56. General challenges of interactivity ✓ Mapping events to components • Building a shared understanding • Partial failure • Scoped conversational state

  57. Building a shared understanding: OO

  58. Building a shared understanding: OO

  59. Building a shared understanding: OO

  60. Building a shared understanding: OO

  61. Building a shared understanding: Actors

  62. Building a shared understanding: Syndicate

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend