Built-in Aliases

Some built-in type names are themselves compiler-provided aliases — convenient default spellings for a specific underlying type. Like any alias they are transparent, so the alias and its target are the same type.

type float = float64;  // compiler intrinsic alias

Default-Width Aliases

These three names alias the most common width of their family, so unsuffixed code reads naturally:

AliasTargetNotes
floatfloat64Type of an unsuffixed float literal
boolbool8The everyday boolean
charchar32A full Unicode scalar value

Target-Dependent Aliases

These names alias a type whose width follows the platform's pointer size — *32 on a 32-bit target and *64 on a 64-bit target. Use them for sizes, indices, and counts that should match the machine's natural word:

Alias32-bit target64-bit target
intint32int64
uintuint32uint64

Semantic Aliases

This name aliases a type of the same width but reads more clearly at the call site. byte is the same 8-bit unsigned integer as uint8; prefer it wherever a value is raw memory rather than a small number — buffers, binary protocol fields, and serialisation:

AliasTargetNotes
byteuint8A raw 8-bit byte; identical in every respect
let header: byte = 0xFF;   // reads as "one raw byte"
let count:  uint8 = 12;    // reads as "a small number"

Because the two are the same type, a byte and a uint8 are interchangeable — you can assign one to the other and pass either to a function expecting the other, with no cast.

See Also