Core Concepts
Understanding rescile as a Declarative Language
To use rescile effectively, it helps to think of it not just as a tool, but as a declarative programming language for defining an infrastructure graph. This section establishes the core “mental model” for this language, explaining how rescile processes rules, iterates over data, and builds your graph.
Understanding these concepts is key to write powerful and predictable configurations.
rescile as a Language: A Glossary
To bridge the gap between traditional programming and rescile’s declarative model, this glossary provides a direct analogy for each key term.
| rescile Term | Programming Language Analogy | Description in rescile |
|---|---|---|
| rescile Configuration | Source Code / Program | The entire set of data/**/*.csv and data/**/*.toml files that define the final graph. |
| Phase (Assets, Models, etc.) | Compiler Stage / Program Section | A distinct step in the processing pipeline (e.g., initialization, main logic, serialization). |
Configuration File (.toml) |
Module / Class / Source File | A file containing a set of rules that operate within a specific context or scope. |
| Module | Reusable Library / Package | A self-contained, parameterizable set of model, compliance, and output files, defined by a module.toml manifest. |
| Header | Module Scope / Global Variables | The top section of a TOML file where the iteration target (origin_resource) and file-scoped data are defined. |
Rule Block ([[...]]) |
Function / Method / Conditional Block | A single, executable instruction within a file, like [[create_resource]] or [[link_resources]]. |
Directive (key = "value") |
Keyword / Command / Parameter | A key-value pair inside a Rule Block that instructs the engine, like resource_type or match_on. |
origin_resource |
The for-each Loop Subject |
Defines the collection of resources that a file’s Rule Blocks will iterate over. |
| Resource (Node) | Object Instance / Struct | An entity in the graph with a type (its class) and properties (its member variables). |
| Relationship (Edge) | Pointer / Reference / Link | A typed, directed connection between two Resource objects. |
match_on / match_with |
if Condition |
A directive that makes the execution of a Rule Block conditional. match_on filters the origin, match_with filters the target in links. |
Tera Template ({{ ... }}) |
f-string / Template Literal / Expression | A string that is evaluated at runtime to produce a dynamic value. |
[[link_resources]] |
Database JOIN / Lookup Function |
A “pull” operation that finds a remote object based on a condition and copies data from it. |
[[copy_property]] |
Property Assignment / Inheritance | A “push” operation that copies data from a source object to an already connected destination object. |