val pope : obj
Full name: index.pope
val shadow : obj
Full name: index.shadow
Rethinking compilers
with live coding
Welcome to the post-fact world
Can the result be reproduced?
Is the visualization misleading?
Can the reader explore further?
The Gamma
Making data science easier
DEMO
Live previews in TheGamma
Textbook compiler is batch based
Textbook compiler builds & transforms trees
Textbook compiler rejects bad programs
Example - live image processing
1:
2:
3:
4:
5:
|
let pope = image.load("pope.png")
let shadow = image.load("shadow.png")
shadow.greyScale().blur(5)
.combine(pope, 50)
|
SKETCH
Transforming abstract syntax trees
DEMO
Writing a batch evaluator
Live compiler caches earlier results
Live compiler builds dependency graphs
Live compiler accepts bad programs
SKETCH
Building a dependency graph
DEMO
Writing a graph-based evaluator
F# language
www.fsharp.org
Pragmatic functional-first programming
|
Fable compiler
www.fable.io
F# to JavaScript compiler for the 21st century
|
Dependency graphs over syntax trees
Reusing nodes enables caching
Good luck writing a decent parser :-)
Now you know how to write
your own live coding environment!
Questions?