StructOp Handbook
Contents Examples Commands

STRUCTURE → EXECUTION

StructOp
Handbook

Declarative by design. Executable by nature.

Describe your application. Understand its behaviour. Control its evolution.

StructOp is a declarative application development platform that transforms structured, human-readable definitions into natively compiled applications. Define application logic, data, dependencies and behaviour using a unified, extensible language, with integrated capabilities for validation, change planning, execution visualisation and build state management.

Build software that is easier for humans and AI to understand, develop and maintain.

Define. Plan. Visualise. Build.

What StructOp does#

How it fits together#

StructOp at the centre of five software development conceptsStructOp sits at the centre of five concepts that it combines: declarative programming, native code generation, state-driven development workflows, extensible providers, and human and AI collaboration.DeclarativeprogrammingNative codegenerationStructOpdeclarative applicationdevelopment platformState-drivenworkflowsExtensibleprovidersHuman and AIcollaboration
StructOp combines five concepts around one declarative representation.

StructOp operates as a declarative layer above C and Rust. You write declarations; StructOp checks them, plans the change, generates source through providers and hands it to the C compiler or Cargo.

  1. Define the application in .st files.
  2. Plan with structop plan to see what will be added, changed or removed.
  3. Visualise run order and dependencies with structop graph.
  4. Build with structop apply, which records state and runs the program.

How StructOp works · The development lifecycle

Tested examples#

209documented projects
195run on both C and Rust
14target-specific
72C examples
43Rust examples
94feature examples

What these figures mean: StructOp’s own catalogue check builds every documented project in a fresh folder as C and as Rust. A run passes when init and validate succeed, plan prints exactly the recorded plan, apply builds the program and its output with the recorded input equals the recorded output, and any project tests pass. With StructOp 0.1.0 on macOS (Apple silicon), on 1 December 2026, 195 projects passed on both targets and the other 14 passed on the one target whose features they use. The same 209 projects pass on Linux, on ARM64 and natively on x86-64. These are StructOp’s own test results for its example catalogue; structop test gives your application the same kind of check. Which examples are target-specific

Beyond the catalogue, a worked application shows an inventory manager with a window, a command line and a database file, built for C and for Rust: its declarations, its recorded output, its 13 tests on each target, what building it brought to StructOp and how it works within version 0.1.0. It is not counted in the figures above.

A first program#

Hello world
main.st
ability "print" "Hello" {
    message = "Hello world!"
}
Program output
Hello world!

See what changes before you build#

Change one line of the first program and ask for a plan. StructOp compares the declarations with the state recorded by the last apply and names the change in terms of the application, before anything is rebuilt.

main.st, as built
ability "print" "Hello" {
    message = "Hello world!"
}
main.st, edited
ability "print" "Hello" {
    message = "Hello, StructOp!"
}
structop plan
$ structop plan
  # program.app will be replaced
  ~ program.app (.structop/build/app)
      ~ ability.print.Hello
          message: "Hello world!" -> "Hello, StructOp!"

Plan: 0 to add, 1 to change, 0 to destroy.

Output of StructOp 0.1.0. The plan names the one ability whose message changed and says the program will be rebuilt. After structop apply, the same command reports No changes. Your application matches the configuration. A plan shows what will change; it does not show that the change is correct.

See where a change fits#

Add one ability to the guided tour’s guest list that prints how many guests there are. The plan names what changed; structop graph -changed draws, in the terminal, where the new ability sits in the run order and what it depends on and reads.

What changed? · structop plan
$ structop plan
  # program.app will be replaced
  ~ program.app (.structop/build/app)
      + ability.print.Count
      ~ ability.enum.Mood
          (run order): 8 -> 9
      ~ ability.struct.Guest
          (run order): 9 -> 10
      ~ ability.value.guests
          (run order): 10 -> 11
      ~ ability.value.i
          (run order): 11 -> 12

Plan: 0 to add, 1 to change, 0 to destroy.
Where it fits · structop graph -changed
$ structop graph -changed
...
┌──────────────────────┐      ┆
│                      │      ┆
│ for.Each (1 ability) ├◄─────┤
│                      │      │
└───────────┬──────────┘      │
            │                 │
            │                 │
            │            depends on
            │                 │
            ▼                 │
┌──────────────────────┐      │
│                      │      │
│    + print.Count     ├◄─────┼─────reads────────────┐
│                      │      │                      │
└───────────┬──────────┘    reads                    │
            │                 │                      │
            │                 │                      │
            │                 │                      │
            │                 │                      │
            ▼                 │                      │
┌──────────────────────┐      │                      │
│                      │      │                      │
│     > enum.Mood      │◄┄┄┄┄┄┤                      │
│                      │      │                      │
...
+ new   > moved
Part of what StructOp 0.1.0 draws for this change. print.Count is new (+): it runs after for.Each and depends on it, and reads data.value.guests, which the loop also reads. The four declarations after it moved one place (>). The drawing shows declared order and dependencies, not everything the program does when it runs.

The change, the whole drawing and the apply

Contents#

New to StructOp? Read What is StructOp?, then build the first program and follow the guided tour. When writing an application, browse the language topics below or open the reference index to look up a block, command or ability.

What is StructOp?

What the platform is, why it exists, how it works and what you can build with it.

First steps

Build a greeting, then follow a guest list from declarations to generated code.

Application language

Find the blocks, values and expressions you need to describe an application.

Build and test

Choose a target, preview changes, manage state and check program output.

Providers and libraries

Select provider families or expose a native library to your program.

Game development

Draw a terminal screen and model a game world with entities and systems.

Reference

Look up a declaration, command flag or provider ability.

Project catalog

Explore working programs with their declarations and output.