Experiments

CUE v0.18.0

Experiments are optional capabilities of the CUE language and its tooling, published for evaluation before they become permanent. Each experiment is opt-in while it matures: you decide when a file or an invocation uses it, and every stage it reaches is tied to a released language version.

Language experiments opted in per file — @experiment(<name>)
preview accepted
withdrawn possible before acceptance
Global experiments opted in per invocation — CUE_EXPERIMENT=<name>
preview on by default accepted
withdrawn possible before acceptance
Reading the timelines
v0.17.0 in preview since that release
v0.9.0v0.13.0 a global experiment: on by default since the second release
v0.9.0v0.13.0v0.15.0 accepted — the history ends green and the opt-in is gone
v0.9.0v0.12.0 withdrawn at the struck-through release

Two kinds, two life cycles

Language experiments change the language itself. A file opts in with the @experiment(<name>) attribute, so adoption travels with the files that need it. A language experiment starts in preview and, once accepted, becomes part of the language — files no longer need the attribute from the version that adopts it. There is no on-by-default stage in between: a file either declares the experiment or uses the released language.

Global experiments change the tooling’s behavior. An invocation opts in with the CUE_EXPERIMENT=<name> environment variable. A global experiment starts in preview, is then usually promoted to on by default — still overridable, now by opting out — and is finally accepted, when the behavior is standard and the flag is retired.

Either kind may instead be withdrawn when evaluation shows it should not become permanent. History is preserved: concluded experiments keep their pages under the index’s past group.

The stages

  • preview — available for evaluation; off unless opted in.
  • on by default — enabled unless opted out (global experiments only).
  • accepted — permanent: part of the language or the standard tooling behavior; the opt-in is no longer needed.
  • withdrawn — evaluation ended without acceptance; the opt-in is retired.

The listings in this topic show each experiment as one segmented timeline: its recorded phases in order, colored by stage as in the diagram above, each segment carrying the release that reached it. A preview segment is italic (still tentative); a struck-through final segment marks withdrawal. Past experiments carry their full history; hovering a segment spells it out.

Version milestones

Every experiment’s page lists the released language versions at which it entered each stage — preview since, on by default since, stable since, withdrawn since. The state shown on these pages is derived from those milestones and the CUE version shown at the top of the page.

Experimental commands

Some cue subcommands are themselves experimental. They are commands, not language or global experiments, and stay in the CUE CLI reference under Commands, marked with an experimental chip.

The listing below shows the experiments currently in flight for the documented version; concluded ones live under Past experiments in the index.

Language experiments

functions v0.18.0
openlists v0.18.0
shortcircuit v0.17.0
try v0.16.0

Global experiments

formatv2 v0.18.0v0.18.0
openapiv2 v0.18.0
yamlgoccy v0.18.0v0.18.0
Install CUE