Recent Developments in Context-oriented Programming (at HPI) Robert - - PowerPoint PPT Presentation

recent developments in context oriented programming
SMART_READER_LITE
LIVE PREVIEW

Recent Developments in Context-oriented Programming (at HPI) Robert - - PowerPoint PPT Presentation

Foundations of Aspect-Oriented Languages (FOAL) Modularity 2015 Recent Developments in Context-oriented Programming (at HPI) Robert Hirschfeld Hasso Plattner Institute University of Potsdam Germany http://www.hpi.de/swa/ Colorado State


slide-1
SLIDE 1

Recent Developments in Context-oriented Programming

(at HPI) Robert Hirschfeld Hasso Plattner Institute University of Potsdam Germany http://www.hpi.de/swa/ Colorado State University, Fort Collins, Colorado 2015-03-16 Foundations of Aspect-Oriented Languages (FOAL) Modularity 2015

slide-2
SLIDE 2

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Some History…

Software Architecture Distributed Processing Environments Dynamic Aspect-oriented Programming Reflective Designs Context-oriented Programming Dynamic Service Adaptation

with Pascal Costanza and Oscar Nierstrasz

2

slide-3
SLIDE 3

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Context

context ? = everything computationally accessible location time of day temperature connectivity bandwidth battery level energy consumption subscriptions preferences age mood…

3

slide-4
SLIDE 4

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Layer 1 Layer 2 Layer n Active layer Class 1

COP Basics Overview

Class 2 Class m Behavioral variation

context introduce activate deactivate remove

4

slide-5
SLIDE 5

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

AOP, FOP, and COP

AOP FOP COP Inverse dependencies 1:n relationships Layers Dynamic activation Scoping

5

slide-6
SLIDE 6

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

COP Extensions (Some…)

  • ContextS
  • ContextS2
  • ContextJS
  • JCop (ContextJ)
  • ContextPy
  • PyDCL
  • UseCasePy
  • PyContext
  • ContextR
  • ContextG
  • ContextAmber
  • L1…4
  • ContextL
  • ContextScheme
  • ContextJ*
  • ContextErlang
  • EventCJ
  • Lambic
  • Ambience
  • COP.JS
  • delMDSCO/cj
  • Phenomenal Gem
  • Subjective-C
  • Context Petri Nets

6

slide-7
SLIDE 7

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Recent COP Developments at HPI

7

tooling use-cases contracts development layers behavioral scoping structural scoping event-based composition reactive composition constraint-based composition constraint layers meta-tracing JITs

developers users VM/runtime image/objects constraint solver

layers only semantics

foundations

Vivide ContextFJ UseCasePy PyDCL Context* ContextJS / Lively ContextJS / Lively L1...4 ContextJS / Babelsberg ContextJS / Babelsberg JCop R/Squeak-VM / PyPy

slide-8
SLIDE 8

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

  • Behavioral (dynamic) scoping

– Dynamic extent of execution – Almost all COP extensions

  • Structural (topological) scoping

– ContextJS – Development layers

  • Open implementation for scoping strategies

– Allows for domain-specific scoping – Mainly applied to UI framework structures

  • Lively: Morphic
  • Webwerkstatt : Parts

Behavioral Variations

8

behavioral scoping structural scoping

Context* ContextJS / Lively

development layers

ContextJS / Lively

slide-9
SLIDE 9

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

  • More applied à more useful
  • In PL work tool support often neglected

– Usually too expensive, especially early… à Need for explorative tool building support

  • Vivide
  • Crosscutting nature of layers lends itself nicely to

crosscutting software engineering concerns

– Explicit use-cases representation

  • UseCasePy

– Dynamic contract layers

  • PyDCL

Development Support

9

tooling use-cases contracts

Vivide UseCasePy PyDCL

slide-10
SLIDE 10

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Reactive Approaches

10

event-based composition reactive composition constraint-based composition constraint layers

ContextJS / Babelsberg ContextJS / Babelsberg JCop

¡Framework ¡ User ¡Code ¡

layer ¡composi3on ¡ layer ¡composi3on ¡ layer ¡composi3on ¡ layer ¡composi3on ¡

Hero ¡ En(tyUI ¡ RegionUI ¡ En(ty ¡ Character ¡ AiCharacter ¡ Knight ¡ Princess ¡ World ¡ Region ¡ GameWindow ¡ WorldUI ¡ ImageProvider ¡ KeyboardListener ¡

slide-11
SLIDE 11

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

  • Semantics and types

– ContextFJ

  • Symmetry

– No classes, only layers – No base system

  • L1..4
  • Sideways composition very expensive

– Runtime support for optimizations – Meta-tracing JITs

  • R/Squeak-VM

– Higher performance à more (meta-level) flexibility

Foundations

11

layers only semantics ContextFJ

L1...4

meta-tracing JITs R/Squeak-VM / PyPy

PT(m, C, L0) undefined mbody(m, C, L′, L) = x.e in D, L′′ mbody(m, C, (L′; L0), L) = x.e in D, L′′

slide-12
SLIDE 12

Robert Hirschfeld (2015) Recent Developments in Context-oriented Programming

Acknowledgements

Pascal Costanza, Hidehiko Masuhara, Atsushi Igarashi, Michael Haupt, Malte Appeltauer, Michael Perscheid, Bastian Steinert, Jens Lincke, Marcel Taeumel, Tobias Pape, Tim Felgentreff, Robert Krahn, Carl Friedrich Bolz, Marcel Weiher, Hans Schippers, Tim Molderez, Oscar Nierstrasz, Shigeru Chiba, Hiroaki Inoue, Tobias Rho, Stefan Udo Hanenberg, Dick Gabriel, Dave Thomas, Gilad Bracha, Alan Kay, Dan Ingalls, Alan Borning, Jeff Eastman, Christopher Schuster, Christian Schubert, Gregor Schmidt, Stefan Lehmann, Matthias Springer, …

12