Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Basic Types

Numeric types

signed integers    unsigned integers   floating point values
  i8                 u8
  i16                u16                 f16
  i32                u32                 f32
  i64                u64                 f64
  i128               u128                f128

Currently, only i32 is supported well.

The default type of integer constants is currently i32, but this will most likely be changed to i64.

Boolean type

Boolean values true and false are of type bool, which is the required type for conditions used in if statements or in pre- and post-conditions among others.

Note that bool is fully implemented as a choice type of two unit types TRUE and FALSE.

Character types

There is no character type. It seems risky to define a type for the current 17 planes of Unicode code points. UTF-8 can address 32 planes in 4 bytes. Chances are high that someone will find a use for the additional planes or even extend UTF-8 to support more than 4 bytes per code point. Using i32 for a code point seems sufficiently safe for future Unicode changes.

nil type

nil is defined as a unit type feature in the standard library. It is intended to be used to represent the absence of a value. Examples may be a lists tail that is empty or the result of a lookup that failed.

void type

void is defined as an absurd feature in the standard library, i.e. a feature that cannot be instantiated since it requires a void type argument. It is intended to be used to represent the absence of a result. void is the result type of an endless loop or a intrinsic features such as fuzion.std.exit that never would return normally.