language · language ·
Ordinary, copy, original, and memoryAddress
Binding modes make value transfer and aliases visible at function and loop boundaries.
Use ordinary parameters by default, copy for an explicit independent value, original for an admitted source alias, and memoryAddress only at a reviewed low-level boundary.
Function(Type value)
Function(Type copy value)
Function(Type original value)
Function(Type memoryAddress value)Status: experimental
Scalar by reference
Use ordinary parameters by default, copy for an explicit independent value, original for an admitted source alias, and memoryAddress only at a reviewed low-level boundary.
cpu · complete-program · type checked
Bump(int original value)
{
value = value + 1
}
Set(int memoryAddress value, int next)
{
value = next
}
int value = 1
Bump(value)
Set(value, 5)
if value == 5
{
Console.Log("byref-ok")
}
else
{
Console.Log("byref-bad")
}
project.mech
package = "tests.compiler.kyber.scalarByReference"
version = "0.1.0"
backend = "kyber"
osTarget = "windows"
archTarget = "x64"
selfContainedApp = false
Notes and source
Alias modes are restricted by type and target.
Task aliases are rejected. memoryAddress is not a general raw-pointer escape hatch.
yeho/memory-lifetime-unsafe-2026.1.json; parser_types.cpp parseParameters