Tomáš Petříček, 309 (3rd floor)
petricek@d3s.mff.cuni.cz
https://tomasp.net | @tomaspetricek
https://d3s.mff.cuni.cz/teaching/nprg077
Did this to get my PhD...
How to show potential uses of theoretical work?
Tiny type system running in the web browser
Tiny demos of two potential applications
Programming is
writing code
Formal semantics, implementation, paradigms, types
We know how
to study this!
Interacting with a stateful system
Feedback, liveness, interactive user interfaces
But how do we
study this?
Making programmatic data exploration accessible to non-programmers
From language to system
Small typed language
Interaction is the key.
This is why it works!
Best way to learn?
Write it on your own!
Understand principles
As well as subtle details
I hope you'll have fun!
Doing more with less?
Imagine new paradigms
Variable names
Focus on interaction
How exactly did it work
Ignore practical details
New mode of interaction
(Kamin, 1990)
Used in multiple
courses worldwide
Examples in Pascal
Languages covered are APL, Clu, LISP, Prolog, Smalltalk, Scheme, SASL
Not always focused
on the key aspect
(Schank, Riesbeck, 1981)
Miniature implementations of 5 Yale AI lab programs
Faster, more efficient, easier to understand, modify and extend
"Miniatures, demos and artworks" by Warren Sack
(Distill, 2016-2021)
Five affordances of interactive articles
Connecting people & data
Making systems playful
Prompting self-reflection
Personalizing reading
Reducing cognitive load
(* A term like 'father(william, X)'
consists of predicate 'father',
atom 'william' and variable 'X' *)
type Term =
| Atom of string
| Variable of string
| Predicate of string * Term list
(* A rule 'head(...) :- body.' *)
type Rule =
{ Head : Term
Body : Term list }
(* A program is a list of rules *)
type Program = Rule list
A good way to explain the structures!
Functional data types for the static and dynamic structure
A function to model the evaluation logic
Standard approach
to programming language theory
Equations vs. Code
Code actually runs!
Easier to write?
Ignore implementation and practical features
Prove that the core idea is formally sound
Ignore inner working and implementation
Show that users can actually use it and how
Ignore usability and design implications
Show that you can do better than a baseline
Why study universally disliked programming language?
Somehow allowed everyone to program!
Interesting mode of interaction!
Functional interactive user interface development
Types for application
State
and user Event
Functions to render
and update
state
Write your own tiny programming system(s)!
Tomáš Petříček, 309 (3rd floor)
petricek@d3s.mff.cuni.cz
https://tomasp.net | @tomaspetricek
https://d3s.mff.cuni.cz/teaching/nprg077
Tiny system examples
Starting points