FoodX
FoodX is Foodlang's portable execution format. A .foodx.yaml file
describes capabilities, inputs, preconditions, effects, confirmations, and error
behavior.
FoodX is both:
- an intermediate compiler IR (recipe → FoodX → machine target), and
- a final executable format for FoodX-compatible machines.
.food ⇄ .food.yaml → .foodx.yaml → targets
Generate
foodlang compile examples/iced-vanilla-latte.food --target foodx
foodlang compile examples/iced-vanilla-latte.food.yaml --target foodx # identical
foodlang plan examples/iced-vanilla-latte.food # same
Compile targets from FoodX
A .foodx.yaml file is itself a valid input — Foodlang reconstructs the recipe
from the plan, so every target works from FoodX too, and matches the
recipe-route output:
foodlang compile examples/iced-vanilla-latte.foodx.yaml --target coffee-mqtt
foodlang compile examples/iced-vanilla-latte.foodx.yaml --target robot-action-graph
foodlang compile examples/iced-vanilla-latte.foodx.yaml --target s88
Source of truth
.food.yaml is authoritative; .foodx.yaml is derived by default and carries a
source reference:
source:
format: food.yaml
detached: false
If detached: true, the FoodX file is treated as an independent executable plan.
Profiles
A FoodX file declares a profile so a machine can say "I support this":
foodx.core.v1 foodx.coffee.v1 foodx.espresso.v1 foodx.pourover.v1
foodx.robot.v1 foodx.industrial.v1
When is FoodX executable?
Only when the file validates against the FoodX schema and the target machine declares FoodX support, the required profile, and all required capabilities. Foodlang does not overpromise native execution.