Primitive types

Core provides numeric types, a Unicode scalar char, booleans and void.

Integer types

TypeSignedWidth
byteNo8-bit
sbyteYes8-bit
shortYes16-bit
ushortNo16-bit
intYes32-bit
uintNo32-bit
longYes64-bit
ulongNo64-bit

Unicode characters

Xenon char represents exactly one Unicode scalar value and always occupies 4 bytes. Valid values are U+0000 through U+D7FF and U+E000 through U+10FFFF; UTF-16 surrogate values are excluded. Its default value is U+0000.

char latin = 'A';
char cyrillic = 'Ж';
char emoji = '😀';

char is distinct from every integer type. It is not a byte, a UTF-8 byte, a UTF-16 code unit or a grapheme cluster. A combining sequence such as e plus a combining acute accent contains two scalars and therefore cannot be one char.

Equality and ordering compare scalar values. Arithmetic is not defined for char; integer interoperation requires an explicit cast.

Target-sized integers

nint and nuint match the target pointer width. They are useful for native addresses, allocation sizes and offsets.

clong and culong match the selected platform's C ABI definition of long and unsigned long.

nuint size = 4096;
clong nativeResult = 0;

Floating-point and boolean types

float is IEEE-754 binary32 and double is IEEE-754 binary64. Conditions use the dedicated bool type and the values true and false.

float speed = 5.0f;
double elapsed = 10.5;
bool running = true;

void describes a function with no return value and also forms the untyped pointer void*.