Basic Types and Values

Jai comes with a number of basic types, along with some mechanisms to create custom types.

The basic types are:

  • bool - a boolean, that can take values true or false.
  • s8, u8 - signed and unsigned 8 bit integers.
  • s16, u16 - signed and unsigned 16 bit integers.
  • s32, u32 - signed and unsigned 32 bit integers.
  • s64, u64 - signed and unsigned 64 bit integers.
  • float32 - 32 bit floating point number.
  • float64 - 64 bit floating point number.
  • string - a string, an array view of u8. Jai strings are NOT zero-terminated

Additionally, there are int which defaults to s64 and float which defaults to float32. The type void also exists, but you’ll probably use it less than in some other languages that have that type.

1 Like