Programming systems, or

what programming language
research cannot see

Tomas Petricek, Charles University, Prague

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

1 INTRO - HyperCard demo - 2 TECH DIMS - Timeline 4 COMPLEMENTARY - C64 3 FORMAL - TheGamma 5 HCI - Denicek 6 CONCLUSIONS

Intro

Programming systems

Apple HyperCard

Hypermedia system

Help humankind
share knowledge

Allowed lots of people to create small apps

What does a PL researcher see?

This is a 90-minute talk!

Let's make it a bit interactive!



What can a programming languages researcher say about HyperCard?

Demo

HyperCard in action!

Interesting HyperCard facts

Unprecedented usability

  • Same environment for authoring & use
  • Controlled via user levels

Stateful interactive system

  • Scripts live inside the stateful app
  • Stacks are open to modification by default

No modern equivalent

  • Hypermedia evolved into the Web
  • What got lost in the process?

Programming systems

Different ways of looking

Programming systems

Different ways of looking

  • Technical dimensions - heuristic analysis
  • Complementary science - past systems
  • Formal models - theory of systems
  • User centric - talking to users

Technical dimensions

Qualitative systems analysis

Timeline

Adding time to spreadsheets

Most widely used programming sys!

Keep simplicity & add expressivity

Comparison with using Python?

Experiment with Timeline!

Go to: https://timelinesheets.com
Or try: https://tinyurl.com/ecoop26-bird

Create simple time-aware calculations

A1 = 0 => A1[-1] + 1
B1 = 0 => B1[-1] + RAND(1) - 0.5


Audience participation :-)

How does spreadsheet system
(with time) compare to Python?

Technical dimensions

What is a dimension

  • Captures a property of a system
  • Covers old and new systems
  • Defines a range of values

Using the framework

  • Identify gaps in design space
  • Characterise new and old systems
  • Qualitative comparison of systems

Catalogue

Analysed systems

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

tomasp.net/techdims

Analysis of HyperCard

Modes of interaction

Programming happens in the
same interface mode as using

Primary & secondary notation

Graphics and basic interactions constructed graphically; script is secondary

Self-sustainability

Clear separation between app itself and
user code; cannot be modified from within

Analysis of Timeline

Analysis of Timeline

Modes of interaction

Programming happens in the
same interface mode as using

Abstraction construction

Code reuse by creating formula and using "drag down"

Composability vs. convenience

Timeline has composable charting primitives
but no built-in high-level charts

Complementary science

Learning from the past

Complementary science

Scientific ideas get lost due to paradigm shifts

There is often something valuable lost too.

Do serious historical research to recover them!

Even more the case
in programming!

Commodore 64

"It is impossible to teach good prog­ramming to stu­dents that have had a prior expo­sure to BASIC" (Dijkstra)

What can we learn from BASIC?

Experiment with C64 BASIC!

https://tomasp.net/commodore64

Try printing Hello world!
PRINT "HELLO WORLD"

Try writing an infinite loop!
10 PRINT "HELLO WORLD"
20 GOTO 10


Audience participation :-)

Is there anything good about prefixing each
line with a number? What is the point?

Pygmalion

Visual programming system based on demonstration

Largest Smalltalk 74 program ever written

What does using Pygmalion feel like?

https://tinyurl.com/ecoop26-pygm

Learning from Pygmalion

Abstraction construction

  • From concrete manipulation
  • Programming by demonstration

Visual programming

  • Good iconic representations?
  • Difficult in an abstract domain!

Learning from Commodore 64 BASIC

Learning from Commodore 64 BASIC

Modes of interaction

Terminal works as both REPL
and structure code editor

Factoring of complexity

Simple but experts can use POKE and SYS

Learnability

Simple unstructured language
Demos distributed as source in magazines

Formal models

Modelling interactive systems

The Gamma

Programming for non-programmers

Explore data by repeatedly choo­sing from a list of offered options

What is the underlying language?

Explore Olympic medals in The Gamma!

https://thegamma.net or directly
https://tinyurl.com/ecoop26-olympics

Known issues in Firefox (sorry)
Old and buggy data (also sorry)

Type olympics. and choose an operation. Get top medalists or top teams?


Audience participation :-)

What is the model of The Gamma language
or system? Is there a formal grammar?

Histogram

Programs as lists of interactions

Keep track of the process!

Running code, refactoring

tomasp.net/histogram

Formal models of programming systems

Formal models of programming systems

Grammar of The Gamma language

Program is a sequence of let bindings or invocations
Lambda only used as method parameter!

\[\newcommand{\lsep}{\;\;|\;\;} \newcommand{\kvd}[1]{\textbf{#1}} \newcommand{\narrow}[1]{\hspace{-0.6em}#1\hspace{-0.6em}} \begin{array}{lcl} p &\narrow{::=}& c_1; \ldots; c_n\\ c &\narrow{::=}& \kvd{let}~x = t \lsep t\\ \end{array} \quad \begin{array}{lccl} t &\narrow{::=}& o &\hspace{-1em}\lsep x \lsep t.m(e, \ldots, e) \\ e &\narrow{::=}& t &\hspace{-1em}\lsep \lambda x\rightarrow e\\ \end{array}\]

Reflects how data science scripting works!
We can get a preview for any sub-expression

Formal models of programming systems

Programming as list of interactions

Record operations as performed by the user!

\[\newcommand{\narrow}[1]{\hspace{-0.6em}#1\hspace{-0.6em}} \begin{array}{rcl} p &\narrow{::=}& i_1, ~\ldots,~ i_k\\ r &\narrow{::=}& \textbf{named}~n~~|~~\textbf{indexed}~i\\ i &\narrow{::=}& \textbf{def}~\textit{value}\\ &\narrow{|}& \mathbf{name}~\textit{ref}~\textbf{a}~\textit{name}\\ &\narrow{|}& \textbf{dot}~\textit{name}~\textbf{on}~\textit{ref}\\ &\narrow{|}& \textbf{apply}~\textbf{args}~\textit{ref}_1, \ldots, \textit{ref}_n~\textbf{to}~\textit{ref}\\ &\narrow{|}& \mathbf{evaluate}~\textit{ref}\\ &\narrow{|}& \mathbf{abstract}~\textbf{from}~\textit{ref}_1, \ldots, \textit{ref}_k~\textbf{to}~\textit{ref} \end{array}\]

We can talk about interesting things!
Render program as code or spreadsheet
Refine type information after \(\textbf{evaluate}\) interaction

Methods & formats

Explaining interactive systems

Denicek

Computational substrate for end-user document-oriented programming


Makes implementing
such systems easy!

Experiment with Denicek!

https://tinyurl.com/ecoop26-denicek

Replay the steps of Chapter 1 demo
Invoke @normalize! in step 4 yourself




Audience participation :-)

Compare an interactive essay with a classic paper!
Did you break it? Did you learn something extra?

Medium is the message

What do we choose to ignore?

  • Conventional academic papers
    Ignore complexity, capture essence as formulas
  • Video demos and webcasts
    Show interaction, but what are the limits?
  • Interactive essays
    Guided walkthrough based on system prototype

Conclusions

Programming systems research

Research methods

  • Qualitative analysis
    Mapping the design space of systems
  • Formal models
    Systems view breaks conventional wisdoms
  • Human-computer interaction
    How are systems used, how could they be used
  • Complementary science
    Learning from interesting past systems

Programming systems, or what

programming language research cannot see

Systems view opens new research questions

We can use many different research methods

AI agents interact with programming systems too

Tomas Petricek, Charles University, Prague

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