Tomas Petricek, Charles University, Prague
Languages and
Type systems
Worked on F# and coeffect systems
Programming Systems
Think about state and interaction!
History of Programming
Recovering
lost ideas
We have pretty
smart students!
Lots of freedom in
how & what to teach
How can I teach all
the things that I like?
// A term can be either atom (...),
// variable (...), or predicate (...).
type Term =
| Atom of string
| Variable of string
| Predicate of string * Term list
// A clause is for example:
// 'mortal(X) :- human(X)'
// It consists of 'head :- body'
type Clause =
{ Head : Term
Body : Term list }
// A program is a list of clauses
type Program = Clause list
TinyProlog definitions
Comments shortened
Given to the students
Great starting point!
let rec unifyLists l1 l2 =
match l1, l2 with
| [], [] ->
// Succeeds, but returns
// an empty substitution
failwith "not implemented"
| h1::t1, h2::t2 ->
// Unify h1 with h2 using unify
// and t1 with t2 using unifyLists
failwith "not implemented"
| _ ->
// Lists cannot be unified
failwith "not implemented"
and unify t1 t2 =
match t1, t2 with
| _ ->
// Add all the necessary
// cases here! (...)
failwith "not implemented"
Function signatures
Often empty, with detailed comments and some hints or code structure
Step-by-step structure Copy implementation from previous step
Type system not much help!
type Objekt =
{ mutable Slots: Slot list
mutable Code: Objekt option }
and type Slot =
{ Name: string
Contents: Objekt }
Why study universally disliked programming language?
Somehow allowed everyone to program!
Interesting mode of interaction!
Formal proofs, about tiny models
Performance, in controlled environment
Usability or flexibility, in specific scenarios
Experience of working with a system on a tiny scale
Conceptual structure?
Potential of the design?
Technical dimensions?
(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
Fun course to teach & fun format!
Good way to explain basic concepts
Concepts over formalism or engineering
Past, present & future of programming
Tomas Petricek, Charles University, Prague