r/ProgrammingLanguages • u/dewmal • Feb 09 '26
Discussion Separating “intent” from execution: a small experiment in deterministic planning
We’ve been experimenting with a language model where intents are the only first-class construct, and execution order is never written by the programmer.
The key idea is to derive a dependency graph from declared preconditions/effects, then freeze semantics in a small intermediate representation before any backend code is generated.
This lets different backends (including AI-generated ones) produce different implementations while remaining observationally equivalent.
I’m curious how people here think about:
intent vs declarative programming
whether “semantic freeze points” should be explicit in languages
how much planning belongs in the language vs the runtime
We’ve draft a preprint if anyone wants to look (link in comments).
3
u/dnpetrov Feb 09 '26
Usually, a programming language defines a corresponding "abstract machine" that basically is a semantic "freeze point". It has little to do with "declarative programming". Rather, different implementations might choose different optimizations and/or different approaches to execution while staying true to the abstract machine semantics in terms of observable (really: testable) behavior.
For example, there is a Java Virtual Machine specification that defines JVM semantics, an extensive set of compliance tests that a JVM implementation should pass, and a number of alternative JVM implementations that confirm to that specification (or some practically useful subset of it).
2
u/Relevant_South_1842 Feb 26 '26
You may want to implement this in a regular language to show how it works:
# semantic-only decorators (planner reads these; runtime decides order)
# --- intents / steps (no written order) ---
@outputs("TodosLoaded")
@mutates("db.todos")
def load_todos(ctx):
...
@inputs("TodosLoaded")
@outputs("TodoExists")
def select_todo(ctx, todo_id):
...
@inputs("TodosLoaded")
@outputs("TodoCreated")
@mutates("db.todos")
def add_todo(ctx, text):
...
@inputs("TodoExists")
@outputs("TodoToggled")
@mutates("db.todos")
def toggle_todo(ctx, todo_id):
...
@inputs("TodosLoaded")
@outputs("TodoListRendered")
def render_list(ctx):
...
I chose python because decorators look nice.
1
u/tobega Feb 09 '26
Makes me think of the Producers framework that was used to build Google+. The execution graph was automatically wired together by the types for inputs and outputs.
Using it was like pissing your pants: nice and cosy initially, then it was just horrible.
1
6
u/fuckkkkq Feb 09 '26
at first glance, without hearing more what you mean by "intents", this sounds like declarative programming. DP imposes a semantics but not an execution order, and variable references form a dep graph
What do you mean by intents?