Language
Language tour
Language Tour
This page gives a conceptual map of Grapheme syntax and workflow structure.
Mental Model
A Grapheme program defines one or more executable units (for example, queries or mutations) that compose module operations into a stateful flow.
Think in three layers:
- intent (what outcome you want),
- flow (how data moves and branches),
- capabilities (which modules perform side effects).
Building Blocks
- Imports: declare module capabilities.
- Executables: define named workflow entry points (
query,mutation,iterator, …). - Parameters (0.7.0): named
$paramlists with defaults; bind viacallor CLI--args-json. - Tags /
using(0.7.0): ambient tagged bindings activated for a scoped block. - Operations: call module functions.
- State transitions: evolve structured data through steps.
- Control flow: branch and iterate with explicit intent.
- Stage B AOT (0.7.0): compile/run workflows through the Wasm container path (
grapheme builddefaults tostage_b).
Authoring Style
Prefer:
- explicit data shaping,
- small composable steps,
- stable module ops unless experimental behavior is required.
Avoid:
- hidden side-effect assumptions,
- monolithic workflow blobs,
- overloading one executable with unrelated jobs.
Safety Model
Grapheme is designed to run with policy boundaries around side effects.
In practice, that means your workflow logic and operational permissions stay separate:
- source defines intent,
- runtime policy defines allowed external actions.
Learn by Running
Use these examples to see core language patterns:
examples/hello-world.grexamples/params-call-bind.gr(executable parameters)examples/tag-using-scope.gr(tags + scopedusing)examples/core-merge.grexamples/core-filter.grexamples/resilience-composition.grexamples/mutation-state-machine-apply.gr
Author extract: docs/internal/language/params-and-tags-v1.md.
Then progress to scenario playbooks in playbooks.md.