Exploring the design space of programming systems

Tomas Petricek, Charles University, Prague

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

How this fits together?

Opening the software black box

  • Systems that let users look inside
  • Easy to use, understand and adapt!
  • What happened to the 1970s attempts?
  • How to talk about interactive systems?

Programming systems

and their technical dimensions

Programming Languages

Programming is
writing code

Formal semantics, implementation, paradigms, types

We know how
to study this!

Programming Systems

Interacting with a stateful system

Feedback, liveness, interactive user interfaces

But how do we
study this?

Paradigm shift in 1990s

Scientific paradigm shifts

  • The past is a foreign country
  • Paradigms are incommensurable
  • Old notions stop making any sense

From systems to languages

  • From CLOS and Flavors to mixins
  • From running system to code
  • From state & interaction to semantics

Looking at programming systems

They are interactive

  • Hard to see interaction "on paper"
  • Screencast, interactive essay
  • What makes for a rigorous demo?

What to say about them

  • Here is a cool new system!
  • Essential characteristics?
  • How to compare, advance and
    stand on the shoulders of giants?

Technical dimensions

What is a dimension

  • Capture interesting properties
  • Cover old and new systems
  • Allow qualitative comparison

Example dimensions

  • Modes of interaction
  • Uniformity, conceptual structure
  • Learnability & sociability

Technical dimensions catalogue

Analysis of:

LISP machines,
UNIX, Hypercard, Spreadsheets,
Haskell, Boxer,
Web, Dark, etc.

How to use dimensions

Analysis tool

  • What makes system interesting?
  • Compare against existing
  • Does not say what's good!

Design space mapping

  • Discover design opportunities
  • Are there blank areas?
  • Graphical self-sustainable systems!

Design exploration

Documents and edit history

What I want?

A programming system that is

  • Accessible and simple on first encounter
  • But allows power-users to modify the system
  • Can be used in local-first collaborative ways
  • Open and can explain its working

Two ideas

Transparent document format

  • Document with code and data
  • Smalltalk image easier to navigate
  • Also contain evaluation trace!

Program as a sequence of edits

  • Can be replayed to get the document
  • Makes merging documents easier
  • Record and/or analyse past edits?

Demo

Add speaker & refactor list

Sample edits

Shared baseline with multiple sequences of edits added

Typical local-first workflow, with independent edits

Two ways
of merging

Do they result in equivalent documents?

Can we have a conflict that imposes order?

Formulas

Code as document elements

  • Store formulas as trees (AST) in document
  • Render in a (somewhat) nicer way
  • Evaluation adds edits to the log!
  • Beware interactions with edit merging

Code is data

Absolute selectors only for now

A selector
is a sequence of:

  • Field name
  • Index specifier
  • All selector

Demo

Budget calculation & refactor list

Merging of formulas

Edit after formula add

  • Formula exists in the document
  • Structure edit edits structure
    and all references in the doc

Formula add after edit

  • Selectors in newly added edits
    reconciled with all new non-baseline edits
  • Edit adds correct formula!

Evaluation

How it interacts with editing

  • Evaluation adds edits that replace nodes!
  • Same edit reconciliation as before
  • But conflicting edit removes evaluated edit!
  • Sometimes, they could adapt though...

Demo

Adding a speaker and evaluation

Future directions

  • Formally show edits can always be merged?
    Maybe, but probably only for a very small subset
  • Projectional editing for nicer experience
    Could editors written in the document itself?
  • Rethinking abstraction and copy & paste
    Abstract past edits, programming by demonstration
  • Add user interactions, also as edits
    How soon will this become unmaintainable?

Complementary science

Learning from past systems

DEMO

How Tomas learned programming

Learning from past systems

What's cool about 90s web?

  • Source code available & accessible
  • Easily extractable & copyable snippets
  • Poor engineering in a poor language!

Complementary science

  • Do (serious) history to recover ideas
  • Lost due paradigm shifts in science
  • Even more powerful for computing!

Good old systems

What have we forgotten about?

  • Pygmalion - program by direct manipulation
  • HyperCard - usability, levels, editing = running
  • Boxer - program as transparent document
  • Interlisp - code = data, modifiable, live coding!

DEMO

Recovering Commodore 64 BASIC

Commodore 64

What makes this interesting?

  • Editing & running as one mode of interaction
  • Load code even to run a game!
  • Learning by copying code from magazines
  • Convenience with escape hatches (POKE)

Conclusions

Programming systems

Open positions
in Prague

Postdoc and PhD funding available

Growing PL group
with more people starting soon

Email me to
learn more!

Systems ⊃ Languages

  • Need new research methodologies
    Qualitative, formal, historical, etc.
  • New designs outside of LISP or Smalltalk
    Document-based with edit history?

Tomas Petricek, Charles University, Prague

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