In English, there are four different types of sentences —
imperative sentences give a command (“Turn on the water.”)
declarative sentences provide a statement (“The water is on.”)
interrogative sentences ask a question and end with a question mark (“What temperature is the water?”)
exclamative sentences express strong feelings or emotions and end with an exclamation point (“The water is too hot!”)
These ideas roughly map to the way that we interface with software. So far, only imperative and declarative systems are well-known:
Imperative interfaces take commands to modify the system state — e.g., creating, starting, stopping, or deleting a server. The end user must navigate the state machine themselves.
Declarative interfaces take a statement and reconcile the system until the statement is achieved — e.g., keep three replicas running at all times. The software runs a reconciliation loop that manages the state machine, doing its best to keep the system state in the desired state.
Declarative systems use imperative statements under the hood.
But where are the other two types of software interfaces, interrogative and exclamative?
What if we are on the verge of discovering the final two types of interfaces in software — interrogative and exclamative? And just like declarative/imperative are paired together, so are interrogative/exclamative. They both might operate on predicting what the desired state should be, rather than having it explicitly stated (declarative). Here’s what they might look like:
Interrogative — LLMs are interrogative machines — they are question-answering interfaces for nearly anything. Before LLMs, it was hard to imagine what it would look like to use software to ask a question over a corpus of data. This lets us query the state machine. Or think of how LLM chaining can produce declarative workflows to answer a question.
Exclamative — Sometimes describing the desired state can be difficult — think of the Goldilocks principle. What’s the right temperature for porridge? Goldilocks tests each porridge and gives feedback (“too hot!”, “too cold!”) until she finds the perfect temperature. Think of how verbose some declarative configuration has become (e.g., Kubernetes). Desired state must cover every edge state transition, which can make it difficult (how many times to retry a failed job, init jobs to run before, cleanup jobs to run afterward). Instead, exclamative interfaces might be feedback machines. Converging to a desired infrastructure based on feedback.
I like the idea of “exclamatory” programming as a channel to provide feedback to a machine system.
I’m not sure if interrogative and exclamative programming models are necessarily coupled. How do data querying languages like SQL, GraphQL and database interfaces compare with the interrogative programming described here? On the surface, I think data querying is equivalent to interrogative programming.
I came here to suggest an improvement to the examples from the version sent through email, but you've already made a better improvement than I could have suggested.
Don't know if it's a trick to get us to visit, but I'll use the opportunity to say I love your content and please keep enlightening us!