notes:language-inspiration
Table of Contents
Inspirations and historical connections for the folk programming language
Note
Note: there are more recent, direct folk
inspiration papers we reference in the Programming language & DB implementation
section of our links page. What follows below is Andrés' attempt to ground our recent (from ~2005 - 2025) citations to the deeper history of programming language design.
The historical roots of Wish, When, and Claim
When
- The journey to a
When
statement begins with the foundational work on event-driven programming in Smalltalk-76 (Ingalls, 1978), which established a model where objects communicated by sending messages, a precursor to modern event handling. - This was refined in Smalltalk-80 (Goldberg & Robson, 1983) with its Model-View-Controller (MVC) architecture, where user actions (events) in the View would trigger changes in the Model.
- Concurrently, the AI community was developing production systems like OPS5 (Forgy, 1981), which used explicit
IF-THEN
rules that reacted to changes in a central “working memory.” - This reactive, rule-based approach was formalized in databases through Event-Condition-Action (ECA) rules (Dayal et al., 1988) and given a temporal dimension in temporal logic programming (Abadi & Manna, 1989).
- A parallel technique emerged from Linda (Gelernter, 1985), where processes could wait for data patterns (using
in
/rd
) in a shared “tuple space,” directly demonstrating a “when this pattern exists, then proceed” model.
- These distinct threads—object-oriented event handling + AI rule-based reactions, database triggers, and pattern-matching coordination — all converged on the core idea of a system that declaratively waits for a condition to become true before executing a behavior. This lineage culminates in modern constructs like the
When
statement infolk
— realtime execution in reaction to database updates rather than the traditional imperativeif
statement.
Wish
-
- Without this 10 page (!) paper we wouldn't have modern logic programming, the foundation of the ability to
Wish
into a shared reactive database in Folk - As ACM noted in 2001 when awarding Kowalski the Lovelace Medal: “his influential dictum
Algorithm+Logic=Control
has shaped our views on the essence of declarative programming within the logic programming framework and has had a large impact on the design of new control mechanisms for this approach to programming. His subsequent research revealed the rich potential of the logic programming paradigm. He showed how legal, metalevel, and commonsense reasoning can naturally be formalized by means of logic programs.”
- This paradigm was first realized in Prolog (Colmerauer, 1972) and later specialized for database queries in Datalog, which provided the “shared database” component of our modern model. It was further generalized by Constraint Logic Programming (Jaffar & Lassez, 1987), which expanded the expressive power of these declarative goals.
- Together, these systems form the heritage of
Wish
: a declarative, goal-seeking mechanism for interacting with a logical model of the world.
Claim
Claim
can be traced back to Bertrand Meyer's “Design by Contract” (DbC), a core feature in the design of the Eiffel programming language first outlined in a 1986 article.- Design by Contract formalizes software modules using three types of assertions: preconditions (
require
), postconditions (ensure
), and invariants. TheseClaims
form a rigorous, checkable contract between a component and its clients.
- The theoretical groundwork for DbC was laid even earlier by work on formal verification. C.A.R. Hoare's axiomatic semantics, or Hoare Logic (1969), used pre- and post-condition triples, `{P} C {Q}`, to logically prove program correctness.
- While formal verification was often heavyweight, Meyer's DbC provided a pragmatic way to apply these ideas to everyday programming. This approach has since influenced assertion and contract features in many languages, including Ada, D, Clojure, and Python's type hinting system.
* Claim
is the direct descendant of this tradition, providing a lightweight but powerful way to assert formal guarantees about a program's behavior at runtime.
Dynamicland | Realtalk
- Andrés and Omar met at Dynamicland in 2017, their experiences with Dynamicland's Realtalk (a superset of Lua) being an inspiration for the creation of folk in 2022.
Realtalk 2017
- Omar spent a few years as a volunteer and then a researcher at Dynamicland and built many things at Dynamicland including, but not limited to:
- Geokit (more context [https://omar.website/posts/notes-from-dynamicland-geokit/|in the form a fantastic blog post from Omar])
- Pi bots — Raspberry Pis on wheels that got their instructions to drive from programs placed on the table
- Andrés was a volunteer at Dynamicland from 2017 to 2019, teaching workshops on Realtalk, giving tours, and writing in Realtalk to make this "book for learning to draw pictures in Realtalk. Each page is a sample program intended to be edited in place.", IAMBICland (a program to display all 154 of Shakespeare's sonnets by placing cubes in the ones, tens, and hundreds position of a number-selector-page), and a few other things.
- While we initially were inspired by the Realtalk paradigm, there are hundreds of influences in programming language theory and, in particular, the history of ProLog, with particular attention to the influences in the Programming language & DB implementation of our links page
- Both
folk
andRealtalk
are reactive DB systems implemented as metalangauges (in Lua and Tcl, respectively)*, though they have diverged in their implementation of OS primitives and the functionality as a result of Folk being in New York City, with a different group of people and concerns about what programs are possible in this tangible paradigm. *
folk
's architecture:- Realtalk (2017)'s architecture:
- Lua core, Lua JIT with C
notes/language-inspiration.txt · Last modified: by admin