StructOp Handbook
Contents Examples Commands
Handbook / What is StructOp?

Design philosophy

Six principles shape the language, the command-line tool and the provider format. Each is followed by the feature that applies it today.

On this page

Software should be understandable#

An application’s structure and behaviour should be accessible to developers without requiring unnecessary interpretation of implementation details.

In practice. A declaration such as ability "print" "Greet" says what it does and gives it a name. The generated source is ordinary C or Rust with one commented block per ability, and a developer does not have to read it to follow the application.

Relationships should be explicit#

Dependencies and execution relationships should be identifiable and inspectable.

In practice. depends_on names what an ability waits for. Reads go through data blocks, and calls name their function. structop graph draws run order, containment, calls, dependencies and data flow as next, contains, calls, depends_on, source and reads edges.

Change should be visible#

Developers should be able to understand proposed application changes before building or applying them.

In practice. structop plan lists every change before anything is built, and apply prints the same plan first. A plan saved with plan -out=FILE is applied exactly with apply FILE; if the configuration has changed since, apply refuses the stale plan.

Native capabilities should remain accessible#

Declarative development should not unnecessarily sacrifice access to established programming languages, native libraries and toolchains.

In practice. Programs are compiled by the C compiler or Cargo. structop bind turns a C library header or a Rust crate into a provider, and the C target accepts inline C expressions where needed.

Extensibility should be foundational#

Developers should be able to extend the platform through providers rather than depending exclusively on capabilities implemented directly within the engine.

In practice. The language fixes the syntax, types, expressions, state model, run order and workflow, but not the vocabulary of ability kinds. print, prompt and if are defined by providers, the same way a community provider defines its own kinds.

Humans and AI should share a common application representation#

Application definitions should be structured in a way that supports both human comprehension and machine processing.

In practice. The .st files are the single representation. A person reads them as text; a tool reads the same project through validate -json, plan -json, graph -json and schema -json, in a versioned format.

Software should not only be executable. It should be understandable, inspectable and intentionally evolvable.