Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

Keywords and Reserved Words

Keywords are reserved words that have special meaning in the language.

Keywords

The following words are keywords and cannot be used as identifiers:

KeywordDescription
borrowBorrow parameter mode
fnFunction declaration
inoutInout parameter mode
letVariable binding
linearLinear struct modifier
mutMutable binding modifier
ifConditional expression
elseAlternative branch
whileWhile loop expression
loopInfinite loop expression
forFor loop expression
inIterable separator in a for loop
matchPattern matching expression
returnReturn from function
breakExit loop
comptimeCompile-time evaluation
continueSkip to next iteration
trueBoolean literal
falseBoolean literal
structStruct definition
enumEnum definition
implReserved syntax; Rue has no impl-block construct (6.0:1a)
interfaceInterface declaration (6.8, --preview interfaces)
selfSelf parameter in methods
dropDestructor declaration
pubPublic visibility modifier
constConstant declaration
checkedChecked block (§9.1)
uncheckedUnchecked function modifier
ptrPointer type constructor (ptr const T / ptr mut T)
externForeign declaration block (extern "C" { … }, ADR-0064)
yieldAccessor body exit (-> borrow T/-> inout T accessors, ADR-0062)

Contextual Keywords

A contextual keyword is an identifier that has special meaning only in a grammatical position that expects it and is an ordinary identifier everywhere else. is is a contextual keyword: it introduces a conformance list after a struct name or after the subject type of a freestanding conformance assertion (6.8:2), and it remains usable as the name of a binding, parameter, field, function, or method.

Type Names

The following are type names and are reserved:

TypeDescription
i88-bit signed integer
i1616-bit signed integer
i3232-bit signed integer
i6464-bit signed integer
u88-bit unsigned integer
u1616-bit unsigned integer
u3232-bit unsigned integer
u6464-bit unsigned integer
f32IEEE 754 binary32 floating-point (§3.12)
f64IEEE 754 binary64 floating-point (§3.12)
boolBoolean type
typeCompile-time type of types
SelfThe enclosing struct type, within a struct block (§6.4)