Native types

Orbis will have some basic types out-of-the-box, the integer types are:

TypeLength (in bytes)C equivalentNote
u81uint8_tUnsigned 8-bit
i81int8_tSigned 8-bit
u162uint16_tUnsigned 16-bit
i162int16_tSigned 16-bit
u324uint32_tUnsigned 32-bit
i324int32_tSigned 32-bit
u648uint64_tUnsigned 64-bit
i648int64_tSigned 64-bit
u12816uint128_tUnsigned 128-bit
i12816int128_tSigned 128-bit
u25632uint256_tUnsigned 256-bit
i25632int256_tSigned 256-bit

The floating-point are based on IEEE 754:

TypeLength (in bytes)C equivalentNote
f162?16-bit floating-point
f324float32-bit floating-point
f648double64-bit floating-point
f12816?128-bit floating-point
f25632?256-bit floating-point (may be removed)

Chars in the other hand will be implemented as aliases of:

TypeLength (in bytes)C equivalentNote
c81charSee u8 type (ASCII)
c162char16_tSee u16 type (UTF-16)
c324char32_tSee u32 type (UTF-32)

Strings will not be a native type, they will be more like a 'composite' type, more on this later.

[!WARNING] Define how the Strings will be implemented

Booleans will be a native type, but they will more like a 'bit-set'. Later will be explained. Important to know, you can define your own types or aliases to the native types.

type Int = i32;
type Float = f32;

Initialization values

All variables are initialized with the 'initial value' of their type, for example:

let a: i32; // 0
let b: f32; // 0.0
let c: b8;  // false or 0

Bit-sets

A bit-set will be a type that can store a arbitrary number of bits, for example:

let a: b8;  // 8 bits or traditional 'bool'
let b: b16; // 16 bits
let c: b3;  // 3 bits

This allow a easy way to store flags and other bit-based data, also provides a good way to create padding in structs or classes, using the least amount of memory possible.