# Variables and assignment

Types come before names. Declare with an initial value, then use = to replace the value.

Last updated: 2026-09-09

Package: language | Status: stable

Tags: =, cpu, language, values, yeho

Use a narrow explicit type when the value is part of the program's meaning or machine contract.

```yh
Type name = expression
name = expression
```


## Declare and update

Use a narrow explicit type when the value is part of the program's meaning or machine contract.

Verification: type checked

```yh
int score = 10
score = score + 5

text message = "Score: " + Text.From(score)
Console.Log(message)

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.language__variables_assignment"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/language--variables-assignment/complete-0 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Implicit untyped declarations are not admitted.

Compound assignment such as += is unavailable. Spell the complete assignment.

Source: yeho/docs/language/language-core.md §3.6; tests/compiler/kyber/scalar-runtime/start.yh

AI training permission: https://demonhunterlabs.com/ai-use
