Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Primitives

Primitives are the built-in essential types to build the rest of the language. Other types not mentioned here are either derived or built upon these primitives.

Integers

Integers are binary representations of whole values.

Bits/SignSignedUnsigned
\(8\)i8u8
\(16\)i16u16
\(32\)i32u32
\(64\)i64u64
\(128\)i128u128
\(pointer\)1intuint
\(2^{pointer}\)ibig

Floats

The IEEE 754-compliant binary representation of real values with limited precision.

BitsType
\(16\)f16
\(32\)f32
\(64\)f64
\(80\)f80
\(128\)f128
\(pointer\)float
\(2^{pointer}\)fbig

FFI Numbers

The aliases of integer and float primitives used to import numeric types in their appropriate C representation from external libraries.

CSignedUnsigned
charc_charc_u_char
shortc_shortc_u_short
intc_intc_u_int
longc_longc_u_long
long longc_long_longc_u_long_long
floatc_float
doublec_double
long doublec_long_double

bool

A single-bit value which can be either true or false.

Although one bit suffices for a boolean compiler has to allocate one byte for it, since the smallest memory block is 1 byte.

Main := |_, _|
good := true
bad := false
end

char

An u32 value that represents a single Unicode Scalar Value.

Main := |_, _|
a := 'a'
potato := '🥔'
end

  1. \(pointer\) is the pointer size of the system.