The graph-native programming language

Programs are graphs.

flowg keeps code in the shared form every language already represents — a typed dataflow graph. Materialize it to any language, lower it to many silicons, and meter every operation in picojoules.

Scroll
I · The value

Every program is already a graph.
Keep it, and the wins compound.

A program is a network of operations connected by typed, directed data flows; every language is a surface over that structure. Keep the graph as the source of truth and the gains are concrete — materialize to any language deterministically, port and edit without re-debugging, rule out whole classes of errors by construction, and route each operation to the lowest-energy silicon with a joule receipt for every one.

22
Primitive node
kinds (closed set)
11
Wire kinds
(ownership semantics)
many
Languages emitted
from one graph
pJ
Cost unit, per op,
per silicon
What it saves

Real savings — in time, energy, and cost.

Port, don’t re-port
Define once; materialize the same program into any language. No manual rewrite per language, and no re-debugging the port — the semantics come from one graph.
Edit without drift
Change the graph and every projection updates deterministically, together. No stale copies, no chasing the same edit across files and languages.
Fewer bugs by construction
Ownership and types live in the wires, so whole classes of errors can’t be expressed — less time spent in testing and debugging on first build, port, and edit.
Faster to done
Materialization is a deterministic lookup, not a guess — instant, repeatable output. Shorter time to a working build, and to every build after it.
Energy you can see
Every operation carries a measured picojoule cost and routes to the lowest-energy silicon. Energy stops being invisible and becomes something you can lower.
Built for the AI economy
When agents emit and edit structure that’s correct by construction, less inference is spent re-checking and repairing — lower cost and energy for every unit of working software.
"The graph is canonical. Text in any language is just one projection of it — produced by lookup, not guessed token by token." The flowg premise
II · The Graph

A typed hypergraph,
not a text file.

Nodes are computation primitives. Edges are resource-semantic wires — Rust's ownership generalized: Move, Borrow, Stream, Feedback, and more. Each Apply node carries an operation with physical cost metadata. This is the IR — the same one the runtime executes.

scale_and_sum.fg
// flowg graph: scale_and_sum  (the graph is the program)
graph scale_and_sum(xs: tensor<f32>, k: f32) -> f32 {
  n0  Param          xs
  n1  Param          k
  n2  Apply mul      (n0, n1)        // Custom("mul")
  n3  Apply reduce_sum (n2)         // → backend chosen by joules
  return n3
}
// wires carry ownership: n0 ──Move──▶ n2 ──Move──▶ n3
Closed kernel
22 universal primitives — computation, resource, error, concurrency, data / state, temporal. A closed, fixed vocabulary for every programming pattern. Not an extensible library — a complete kernel.
Ownership in the wires
11 wire kinds make the semantics explicit: who owns a value, what borrows it, what streams, what loops back — so the system understands them too.
Capabilities & effects
No ambient authority. Effects are declared on the node and checked at dispatch; capability handles are unforgeable and delegable.
III · Materialize

One graph.
Many languages.

The same graph projects to source in many target languages — deterministically, the same output on every machine, every run. Text becomes a view, not the source of truth.

→ rust
fn scale_and_sum(xs: &[f32], k: f32) -> f32 {
    xs.iter().map(|x| x * k).sum()
}
→ python
def scale_and_sum(xs, k):
    return sum(x * k for x in xs)
→ wgsl
// emitted WGSL compute shader (WebGPU)
@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) g: vec3<u32>) {
    out[g.x] = xs[g.x] * k;
}
RustPythonGoTypeScriptCWGSLONNXStableHLOMLIRTritonWASM
IV · Energy

Routed to the silicon that
does it for the fewest joules.

Each operation carries a cost. flowg's placement pass picks the backend — CPU, Metal, AMX, CUDA, WebGPU, Wasm — that runs it at the lowest verifiable joules, with no default to any one device. Every run can produce an energy receipt.

Energy Receipt · scale_and_sum @ apple-m3
total_energy8.42 µJ
  mul → op-metal (gpu)5.91 µJ
  reduce_sum → op-blas (cpu)2.51 µJ
placementmin-joule (measured)
vs cpu-only−38%
determinismstrict · bit-reproducible

Picojoule cost model · analytical prior refined by measured calibration.

V · The Substrate

The shared target
beneath the languages.

flowg is the graph every sibling language lowers into. They differ in surface; the target is identical. A program written in Joule runs a fused kernel on Metal without the language ever naming Metal.

VI · Get Started

Inspect a graph.

Build the toolchain, make a sample graph, and watch it run across devices with a joule receipt.

terminal
$ cargo install flowg
$ flowg make-sample scale_and_sum.fg
$ flowg inspect scale_and_sum.fg
$ flowg run scale_and_sum.fg
  total: 8.42 μJ  ·  placement: min-joule  ·  determinism: strict
Graph-nativeDeterministicHeterogeneousEnergy-meteredWASMWebGPUCapability-typedEdge AI