val pope : obj

Full name: index.pope
val shadow : obj

Full name: index.shadow

Rethinking compilers
with live coding





Tomas Petricek, Alan Turing Institute + fsharpWorks
@tomaspetricek | tomasp.net | fsharpworks.com

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 COMPILERS

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 COMPILERS

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

SUMMARY

Check out TheGamma project

And help make facts great again!


www.thegamma.net

gamma.turing.ac.uk

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?



Tomas Petricek, Alan Turing Institute + fsharpWorks
@tomaspetricek | tomasp.net | fsharpworks.com