PyParis2017 / Incremental computation in python, by Philip Schanely

Pôle Systematic Paris-Region
Pôle Systematic Paris-RegionPôle Systematic Paris-Region
Incremental Computation
in Python
Phillip Schanely
pschanely @medium
pschanely @twitter
The New Messaging App
PyParis2017 / Incremental computation in python, by Philip Schanely
You have no new messages
Joe IDK, let’s go to Sal’s
Sarah LOLZ
Mike Right? I’ve never …
You have no new messages
Joe IDK, let’s go to Sal’s
Sarah LOLZ
Mike Right? I’ve never …
You have no new messages
Joe IDK, let’s go to Sal’s
Sarah LOLZ
Mike Right? I’ve never …
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
The Model-View Problem
Incremental MapReduce in Python
Contents:
The Model-View Problem
Model, M
View, V
Model, M
State Change
Model, M’
View, V
Model, M
State Change
Model, M’
View, V View, V’
Decision Time!
Model, M
State Change
Recompute
Model, M’
View, V View, V’
Model, M
State Change
Infer
Model, M’
View, V View, V’
Model, M
State Change
Invalidate
Model, M’
View, V View, V’
Recompute
Invalidate
Infer
Recompute
Invalidate
Infer
Incremental MapReduce
It’s Everywhere
Javascript
Objects
DOM
Javascript
Objects
DOM
Web Apps
Infer
Recompute
DOM
Pixels
DOM
Pixels
Browsers
Invalidate
Application
Pixels
Display
Application
Pixels
Display
OS Display
Infer
Database
State
API
Responses
Database
State
API
Responses
Backend Logic
Recompute
Normalized
Data
Computed
Data
Normalized
Data
Computed
Data
Application
Databases
Infer
Recompute
Database
Row
Database
Index
Database
Row
Database
Index
Databases
Infer
RAM
Processor
Cache
RAM
Processor
Cache
Multiprocessor
L1/L2 caches
Invalidate
Code
Build
Code
Build
Build Systems
Recompute
Code
Test
Results
Code
Test
Results
Test Runners
Recompute
Incremental MapReduce
Model, M
State Change
Model, M’
View, V View, V’
Incremental
MapReduce
4 6
10
1 5
6
16
4 6
10
1 5
6
16
4 6 1 5
3
Insert “3”
4 6
10
1 5
6
16
4 6 1 5
3
Insert “3”
10 9
19
4
ScenicOverlook
$ pip install ScenicOverlook
4 6 1 5
>>> l = viewablelist([4,6,1,5])
4 6 1 5
>>> l = viewablelist([4,6,1,5])
>>> add = lambda x, y: x + y
>>> l.reduce(add, initializer=0)
16
4 6 1 5 4 6 1 5
3
Insert “3”
>>> l = viewablelist([4,6,1,5])
>>> add = lambda x, y: x + y
>>> l.reduce(add, initializer=0)
16
>>> l = l[:2] + [3] + l[2:]
4 6 1 5 4 6 1 5
3
Insert “3”
>>> l = viewablelist([4,6,1,5])
>>> add = lambda x, y: x + y
>>> l.reduce(add, initializer=0)
16
>>> l = l[:2] + [3] + l[2:]
>>> l.reduce(add, initializer=0)
19
>>> import heapq
>>> def sort(l):
... l = l.map(lambda x:[x])
... return l.reduce(heapq.merge,
initializer=())
>>> l = viewablelist([9, 3, 5, 7])
>>> sort(l)
[3, 5, 7, 9]
>>> sort(l + [ 4 ])
[3, 4, 5, 7, 9]
3 5 79
9 5 73
5 7 93
Graphics Demo
$ python demo_graphics.py
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
PyParis2017 / Incremental computation in python, by Philip Schanely
Compiler Demo
$ python demo_graphics.py
PyParis2017 / Incremental computation in python, by Philip Schanely
Normalize
Generate Call Tree
Normalize
Type Check
Generate Call Tree
Normalize
Type Check
Generate Call Tree
Normalize
LLVM Generation
Type Check
Generate Call Tree
Normalize
LLVM Generation
link
Umut Acar (CMU): “self-adjusting computation”
Matthew A. Hammer: “Adapton”
Interesting Related Work
github.com/pschanely/ScenicOverlook
pschanely @medium
pschanely @twitter
Questions?
1 of 54

More Related Content

What's hot(9)

Project of data structureProject of data structure
Project of data structure
Umme habiba4.5K views
Taylor series part 1Taylor series part 1
Taylor series part 1
aydensmom425 views
Hexadecimal to binary and binary to hexadecimalHexadecimal to binary and binary to hexadecimal
Hexadecimal to binary and binary to hexadecimal
SRM Institute of Science & Technology, Tiruchirappalli88 views
Luhn shLuhn sh
Luhn sh
Ben Pope84 views
Stack1Stack1
Stack1
Iqrazb199 views
Kotlin - Null safetyKotlin - Null safety
Kotlin - Null safety
ss90311114 views
Hexa to binaryHexa to binary
Hexa to binary
myrajendra3K views

Similar to PyParis2017 / Incremental computation in python, by Philip Schanely

Monads in pythonMonads in python
Monads in pythoneldariof
7.8K views47 slides
ShapShap
ShapGiovanni Bruner
1.7K views29 slides
Data Handling.pdfData Handling.pdf
Data Handling.pdfMILANOP1
8 views31 slides

Similar to PyParis2017 / Incremental computation in python, by Philip Schanely(20)

More from Pôle Systematic Paris-Region(20)

Osis18_Cloud : Pas de commun sans communauté ?Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?
Pôle Systematic Paris-Region659 views
Osis18_Cloud : Projet Wolphin Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin
Pôle Systematic Paris-Region231 views
Osis18_Cloud : Virtualisation efficace d’architectures NUMAOsis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Pôle Systematic Paris-Region202 views
Osis18_Cloud : Software-heritageOsis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritage
Pôle Systematic Paris-Region133 views
PyParis 2017 / Un mooc python, by thierry parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
Pôle Systematic Paris-Region2.5K views

Recently uploaded(20)

METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation24 views
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptx
Hajira Mahmood21 views
ThroughputThroughput
Throughput
Moisés Armani Ramírez31 views

PyParis2017 / Incremental computation in python, by Philip Schanely