Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Variant Ownership with Existential Types Nicholas Cameron Sophia Drossopoulou Imperial College London.

Similar presentations


Presentation on theme: "1 Variant Ownership with Existential Types Nicholas Cameron Sophia Drossopoulou Imperial College London."— Presentation transcript:

1 1 Variant Ownership with Existential Types Nicholas Cameron Sophia Drossopoulou Imperial College London

2 2 Outline Variant ownership Existential types for variance Combine with generics for expressiveness

3 3 class List { Object datum; List next; } List

4 4 GUI e.g. window panel1 panel2 button1 button2 button3 button4

5 5 Subtype Variance class Window {... void render(Panel p) { List allWidgets =... ;... }... }

6 6 Subtype Variance class Window {... void render(Panel p) { List allWidgets =... ;... }... }

7 7 GUI e.g. window panel1 panel2 button1 button2 button3 button4

8 8 Subtype Variance class Window {... void render(Panel p) { List allWidgets =... ;... }... } Panel

9 9 Subtype Variance Already exists! – On Ownership and Accessibility (Lu and Potter, ECOOP 06)‏ – any owner in universes (Müller, Dietl,...)‏ – ? in MOJO (Cameron, Drossopoulou, Noble, Smith, OOPSLA 07)‏ –...

10 10 Existential Types List

11 11 Existential Types List

12 12 Existential Types List  o.List

13 13 Owner Polymorphic Methods Useful for iterators, etc. Require existential types Expressible but not denotable types Similar problem to modelling wildcards - e.g., Wed 10:00am

14 14 Generics and Ownership class List { Object datum; } List vs Class List { X datum; } List > [Potanin, Noble, Clarke, Biddle, OOPSLA 06]

15 and Existential Owners  o.List > List >  o.List > List >>

16 16 Benefits Expressive and uniform Easy to reason about Well understood mechanism – Existential types – Wildcards Todo Encapsulation properties Application/relation to other systems

17 17 Thank You!


Download ppt "1 Variant Ownership with Existential Types Nicholas Cameron Sophia Drossopoulou Imperial College London."

Similar presentations


Ads by Google