Timeline: Adding the time
dimension to spreadsheets

Tomas Petricek & Tomáš Boďa
Charles University, Prague

tomas@tomasp.net
https://tomasp.net
@tomasp.net

Third dimension in Excel

Rows for time steps

Columns left for entities and their properties

Two ways of encoding attributes in a sheet

Study participants recognize this as painful

Adding time to spreadsheets

Using programming research in a new way

Spreadsheets as a research problem

Demo

Flappy Bird in Timeline

Adding time to spreadsheets

Implementing counter

A1 = 0 => A1[-1] + 1

Two language additions

A1[-1] to access past values
=> to specify initial value

Synchronous dataflow

Compare formula with Lustre!
nat = 0 -> pre(nat) + 1;

Functional reactive programming

Counting key presses

A1 = 0 => A1[-1] +
  IF(KEYPRESS("A"), 1, 0)

Two reactive concepts

  • Events for discrete events
  • Bahaviors for time-varying values

There is more to do

  • No switching to dynamically
    reconfigure dataflow graph

Composable visualizations

Two problems

  • Excel-like UI does not scale
  • Need to see values over time

Functional approach

  • Domain-specific language
  • Primitives like COLUMN
  • Combinators like OVERLAY, FILLCOLOR
  • Perfect fit for ranges & drag-down interaction

Coeffect-based optimization

How many past values do we need to cache?

  • Track the required number of past values
  • A1[-1] creates \(@\; 1\) requirement at A1

Inspired by dataflow coeffects

\(\dfrac{(x:\tau)\in\Gamma}{\Gamma \;@\; 0 \vdash x : \tau} \qquad \dfrac{\Gamma \;@\; n \vdash e : \tau}{\Gamma \;@\; (n+1) \vdash \textbf{prev}~e : \tau}\)

Timeline

Research questions

Open question

What makes spreadsheets work?

  • Closeness of mapping
  • Low abstraction support
  • High degree of liveness
  • Concrete programming

Adding time

Do we lose something?

  • Closeness of mapping
  • Low abstraction support
  • High degree of liveness
  • Concrete programming

Formal models of spreadsheets

Following style of Gridlets

\(\boxed{\textnormal{Formula evaluation:}~~\sigma \vdash F \Downarrow V }\)

\(\boxed{\textnormal{Sheet evaluation:}~~\sigma \Downarrow \gamma}\)

Evaluation order not fixed

\(\dfrac {\forall a \in \textnormal{dom}(\sigma)~.~\gamma(a) = V \wedge \sigma \vdash \sigma(a) \Downarrow V} {\sigma \Downarrow \gamma}\)

Timeline: Adding time to spreadsheets

We still don't know why spreadsheets work...

Language research applied to spreadsheets!

Think about systems, not languages!

Tomas Petricek & Tomáš Boďa

tomas@tomasp.net
https://tomasp.net
@tomasp.net