Fully Specified Argument Calling
Why Kaya passes arguments by name only
Kaya has exactly one way to pass an argument to a function or node: by name. There are no positional arguments.
function greet(name: string, age: number) {
"Hello, {{name}}! You are {{age}}."
}
greet(name: "Alice", age: 30)This is a deliberate constraint, not an oversight — greet("Alice", 30) is not valid Kaya.
Why named-only
Kaya is designed to be written by language models, and you optimize a language for a model differently than you optimize it for a human typing in an editor. A named argument carries its own label, so the model has to state — right at the call site — what each value is for:
generate(message: "Summarize this", model: "claude-opus", temperature: 0.2)Compare a positional call, where the meaning of each slot lives elsewhere, in a signature the model has to remember correctly:
generate("Summarize this", "claude-opus", 0.2) // not Kaya — which arg is which?The named form costs more tokens. We think that trade is worth it:
- It forces the model to be explicit. Naming each argument is a small act of commitment — the model declares "this string is the message, this number is the temperature" — which makes the call easier to get right and easier to review.
- It is order-independent.
greet(age: 30, name: "Alice")means exactly the same thing asgreet(name: "Alice", age: 30). The model never has to recall a parameter order. - It is stable across change. Add a parameter or reorder a signature and every existing named call still binds correctly.
That last point is the one we care about most. Positional arguments reintroduce a whole class of silent, well-typed bugs:
transfer(sender, recipient, amount)
transfer(bob, alice, 100) // did the model mean sender = bob, or sender = alice?When two arguments share a type, a swapped pair type-checks cleanly and fails only at runtime — exactly the kind of quiet data error Kaya is built to avoid. Named arguments make that mistake unrepresentable:
transfer(sender: alice, recipient: bob, amount: 100)Two ways to think about it
If you come from another language, Kaya's calling convention is probably already familiar — it's the convergence of two patterns you've seen before, reached for different reasons.
Pythonic: required keyword arguments
Python lets you call with positional or keyword arguments. Kaya keeps only the keyword form, and makes it mandatory:
# Python — both work
greet("Alice", 30)
greet(name="Alice", age=30)// Kaya — only the keyword form exists
greet(name: "Alice", age: 30)You can read Kaya as Python where keyword arguments are the only calling style.
TypeScript: the options object with the wrapper dropped
TypeScript has informally converged on the same call site from the other direction. Idiomatic TS frequently takes a single options object instead of a list of positional parameters:
function greet(opts: { name: string; age: number }) { /* ... */ }
greet({ name: "Alice", age: 30 });TypeScript reaches for this for different reasons — to dodge boolean-positional traps, to make optional fields ergonomic, to keep call sites forward-compatible. But the resulting call looks almost identical to Kaya's. Kaya is that pattern with the object braces removed: the argument block is always present and always required, so there is no { } to write.
greet({ name: "Alice", age: 30 }); // TypeScript: options objectgreet(name: "Alice", age: 30) // Kaya: same idea, no wrapperSo a Kaya call reads as Python with required keyword arguments, or as TypeScript with the options-object wrapper dropped. Either way the value is the same: every call states exactly what it is asking for.