Event Type Polymorphism
Rex D. Fernando Robert Dyer Hridesh Rajan
Department of Computer Science Iowa State University {fernanre,rdyer,hridesh}@iastate.edu
This work was supported in part by NSF grant CCF-10-17334.
Event Type Polymorphism Rex D. Fernando Robert Dyer Hridesh Rajan - - PowerPoint PPT Presentation
Event Type Polymorphism Rex D. Fernando Robert Dyer Hridesh Rajan Department of Computer Science Iowa State University { fernanre,rdyer,hridesh } @iastate.edu This work was supported in part by NSF grant CCF-10-17334. Overview Motivation
This work was supported in part by NSF grant CCF-10-17334.
Overview Motivation Language Summary
◮ Formal semantics for event type polymorphism ◮ Simpler semantics, when compared to earlier work Rex D. Fernando, Robert Dyer and Hridesh Rajan 1 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 2 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 3 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 3 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 3 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 4 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 5 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 6 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
◮ No! Passing event closures (next) as argument is illegal.
Rex D. Fernando, Robert Dyer and Hridesh Rajan 6 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
◮ No! Passing event closures (next) as argument is illegal.
◮ Must update all handlers to support that node type!
Rex D. Fernando, Robert Dyer and Hridesh Rajan 6 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
◮ No! Passing event closures (next) as argument is illegal.
◮ Must update all handlers to support that node type!
◮ Must update all handlers and remove that node type! Rex D. Fernando, Robert Dyer and Hridesh Rajan 6 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
◮ No! Passing event closures (next) as argument is illegal.
◮ Must update all handlers to support that node type!
◮ Must update all handlers and remove that node type!
Rex D. Fernando, Robert Dyer and Hridesh Rajan 6 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 7 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 7 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 7 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 8 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 8 Event Type Polymorphism
Overview Motivation Language Summary An Example - No Event Type Polymorphism Example Revisited - With Event Type Polymorphism
Rex D. Fernando, Robert Dyer and Hridesh Rajan 8 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 9 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 10 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 11 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 12 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 13 Event Type Polymorphism
Overview Motivation Language Summary Syntax Type-checking Rules Sub-event Relation Summary
Rex D. Fernando, Robert Dyer and Hridesh Rajan 14 Event Type Polymorphism
Overview Motivation Language Summary
◮ Implicit announcement allows ambiguity ◮ Harder to reason about what event(s) announced
◮ Does not support width subtyping ◮ Limits the ability to specialize sub-events Rex D. Fernando, Robert Dyer and Hridesh Rajan 15 Event Type Polymorphism
Overview Motivation Language Summary
◮ Non-trivial to implement Rex D. Fernando, Robert Dyer and Hridesh Rajan 16 Event Type Polymorphism
Overview Motivation Language Summary
◮ Ability to quantify over a hierarchy of events ◮ Allows for code re-use in event definitions and handlers ◮ Better maintenance - for both adding and removing events
◮ Event types have inheritance ◮ Allow width and depth subtyping of context ◮ Handlers also handle sub-events
◮ Formal semantics for event type polymorphism ◮ Simpler semantics, when compared to earlier work Rex D. Fernando, Robert Dyer and Hridesh Rajan 17 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 18 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 19 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 20 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 21 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 22 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 23 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 24 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 25 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 26 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 27 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 28 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 29 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
Rex D. Fernando, Robert Dyer and Hridesh Rajan 30 Event Type Polymorphism
Appendix Full Syntax Auxilliary Methods Type-checking Rules Future Work
◮ Handling a supertype event requires the entire hierarchy rooted
◮ But to maintain separate compilation and type checking, event
◮ What happens when loading new subtypes and handlers
Rex D. Fernando, Robert Dyer and Hridesh Rajan 31 Event Type Polymorphism