Types

Primitive types

TypeSizeDescription
bool1 bitTrue or false
u8 -- u648--64 bitsUnsigned integers
i8 -- i648--64 bitsSigned integers (two's complement)
f3232 bitsIEEE 754 single-precision float
f6464 bitsIEEE 754 double-precision float

Sub-byte types

TypeSizeDescription
u1 -- u71--7 bitsUnsigned sub-byte integers
i2 -- i72--7 bitsSigned sub-byte integers

Sub-byte fields are packed LSB-first within each byte. This is unique to Vexil -- Protocol Buffers and other formats cannot represent fields smaller than one byte.

Semantic types

TypeWire encodingDescription
stringLEB128 length + UTF-8Text
bytesLEB128 length + rawBinary data
uuid16 bytesUUID as raw bytes
timestamp64-bit signedUnix epoch (interpretation is application-defined)
rgb3 bytesRed, green, blue
hash32 bytesBLAKE3 hash

Parameterized types

TypeDescription
optional<T>Presence bit + value
array<T>LEB128 count + elements
map<K, V>LEB128 count + key-value pairs
result<T, E>Boolean tag + ok or error value

Wire encoding

All types encode to a deterministic byte sequence. Fixed-size types pack at their natural bit width. Variable-length types (string, bytes, array, map) use LEB128 length prefixes.

The @varint annotation changes a fixed-width integer to unsigned LEB128 encoding. The @zigzag annotation uses ZigZag encoding for signed integers (small magnitudes use fewer bytes).

See the language specification for complete encoding rules.