language · language ·

Tuples and deconstruction

Tuple values are an opt-in experiment, gated by tuple-values, and currently run only through generated C++.

boundariescomplete-programcpudeconstructintolanguageoftupleyeho

Prefer a named thing when the values have domain meaning. Use tuples only for deliberate compiler research behind the feature gate.

tuple of Type, Type
tuple(value, value)
deconstruct value into first, second

Status: generated-cpp-only

Tuple opt in

Prefer a named thing when the values have domain meaning. Use tuples only for deliberate compiler research behind the feature gate.

cpu · complete-program · type checked

SplitScore(text name, int score) returns tuple of text, int
{
    return tuple(name, score)
}

tuple of text, int pair = SplitScore("Ava", 7)
deconstruct pair into player, score
Console.Log(player)
Console.Log(Text.From(score))
project.mech
package = "tests.compiler.experiments.tupleOptIn"
version = "0.1.0"
backend = "cpu-oracle"
experiments = ["tuple-values"]
Notes and source

Requires the tuple-values project gate.

The fallback is a named thing with fields that preserve meaning.

yeho/advanced-features-2026.1.json; tests/compiler/experiments/tuple-opt-in/start.yh