From Prompts to Programs: Why We Need a Compiler for LLMs

Early computing started with logic gates. We wrote in binary because we could reason about how bits flowed through circuits. As complexity grew, we invented assembly languages to abstract over machine code: still low-level, but easier to manage. Eventually we built high-level languages like C that let us describe intent, not instruction sequences.

Each jump in abstraction made us more productive. It let us build larger, more reliable systems without needing to hold every gate or register in our head.

We’re hitting the same point in LLM development.

LLMs today are logic gates — powerful, expressive, and composable. Prompts are our binary. You can wire together a few models, handcraft their inputs and outputs, and get something useful. But once you go beyond a handful of prompts — say, in agent systems, retrieval pipelines, evaluation layers — the complexity gets out of hand. It’s like writing an OS in raw assembly.

We need to move up the stack.

That’s what Selvedge is for: a compiler for LLM workflows. It’s a typed, declarative way to describe what you want, and a system that figures out how to make it happen.

Selvedge lets you define structured programs that wrap model calls, validate outputs, compose reasoning steps, and orchestrate everything with explicit control flow. The primitives are predictable. The types are enforced. The intermediate states are inspectable. It turns prompt soup into programs you can debug. The best part is — you barely write prompts.

Image

Think of it like:

  • C for LLMs: you define the logic, not the token stream
  • SQL for cognition: you declare what you want, not how to traverse the model

We don’t think in prompts. We think in goals, logic, and flow. And the systems we’re building now — agents, copilots, assistants, autonomous processes — deserve tooling that reflects that.

Selvedge is an early step in that direction. A compiler for intent.

A language for AI native programs, not just prompts.

--

If you have any questions or thoughts, don't hesitate to reach out. You can find me as @viksit on Twitter.