DEV Community

Yuji Kuroki
Yuji Kuroki

Posted on

Prompts: A Layer Above Declarative Programming?

Let’s chew on that question and follow the chalk-lines it draws to see what we uncover.



Let's kick off with two fundamental styles of programming: Declarative and Imperative.

Expression Style
Declarative
Imperative



When you ask for examples, it shakes out like this:

Expression Style Language Type Typical Medium (there’s always a spectrum)
Declarative DSLs, programming languages SQL, Prolog, Terraform
Imperative Machine code, programming languages Machine code, Assembly, C



The two styles map nicely onto What and How.

Layer Expression Style Language Type Typical Medium (there’s always a spectrum)
What Declarative DSLs, programming languages SQL, Prolog, Terraform
How Imperative Machine code, programming languages Machine code, Assembly, C



In practice, the What layer often sprinkles in a dash of How. Here’s that nuance:

Layer Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
What What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How How Imperative Machine code, programming languages Machine code, Assembly, C



If there’s a What and a How, surely a Why sits on top, no?

Layer Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
Why ? ? ? ?
What What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How How Imperative Machine code, programming languages Machine code, Assembly, C



Zoom out one more notch and you can label what each layer actually describes:

Layer Describes Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
Why Outcome ? ? ? ?
What Output What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How Procedure How Imperative Machine code, programming languages Machine code, Assembly, C



Now, in modern software development we do have a tool for writing Outcomes—just hand them to an AI. Tell the model you want to boost your store’s conversion rate and it happily decomposes that wish into Change the CTA color, Resize the button, and so on. The “Expression Style” for this tier? Optative feels about right.

Layer Describes Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
Why Outcome Why, What, How Optative Natural language Prompts
What Output What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How Procedure How Imperative Machine code, programming languages Machine code, Assembly, C



Notice the pattern: the What layer punts the How to a runtime, and the Why layer punts the What to an agent.

Layer Delegates Downward Describes Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
Why Leaves the What to the agent Outcome Why, What, How Optative Natural language Prompts
What Leaves the How to the runtime Output What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How Leaves execution to hardware Procedure How Imperative Machine code, programming languages Machine code, Assembly, C



Push the thought experiment further and another layer emerges—one that generates the Why itself.

Layer Delegates Downward Describes Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
? Leaves the Why to ? ? ? ? ? ?
Why Leaves the What to the agent Outcome Why, What, How Optative Natural language Prompts
What Leaves the How to the runtime Output What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How Leaves execution to hardware Procedure How Imperative Machine code, programming languages Machine code, Assembly, C



Ultimately, Why/Outcome boils down to “intent” or “will.” What does it look like when that’s generated automatically? Climbing from How up to What and Why, we shift from machine-centric to human-centric communication. One layer higher and even explicit communication fades: your clickstream, biometrics—perhaps every scrap of lifelong data—feeds a super-agent that predicts, proposes, and acts on what you should want next. The input isn't something you write; it's just you.

Layer Delegates Downward Describes Writable Scope Expression Style Language Type Typical Medium (there’s always a spectrum)
Being Leaves the Why to the super-agent Unwritten Unwritten Unwritten (vast contextual data, incl. activity logs, are the input) Non-verbal Your / the business’s very existence
Why Leaves the What to the agent Outcome Why, What, How Optative Natural language Prompts
What Leaves the How to the runtime Output What, How Declarative DSLs, programming languages SQL, Prolog, Terraform
How Leaves execution to hardware Procedure How Imperative Machine code, programming languages Machine code, Assembly, C



We started with the tango between Declarative and Imperative, climbed the recursive staircase to discover Optative Programming, and finally glimpsed a Being layer. Thanks for reading along.


  • I’d love to hear your thoughts!
  • If there are any technologies you’re keeping an eye on in the realms of Optative Programming or the Being layer, let me know—imaginative ideas are also welcome!

Top comments (0)