Skip to content
Paolo Angeli edited this page Nov 1, 2019 · 3 revisions

Native types in Jai are defined in Type_Info_Tag enumeration in the Preload.jai file.

Everything defined in this file is automatically included by the compiler in every program.

Booleans

The classic boolean type whose values can be true or false is defined using the bool signature.

Numeric

Integrals

The default type of this category is int and it is a 32 bit signed integer type. It is an alias to s32. The variants for integral types are: u8, u16, u32, u64 unsigned versions Or: s8, s16, s32, s64 signed versions Each of them indicates the number of bits used for the internal representation in memory.

Floating point

The default type in this category is float and it is a 32-bit single-precision floating-point type. It is an alias to float32. The double-precision version is named float64.

Enums

They are collections of numeric constants.

Pointers

They are u64 values designated to handle the in-memory address of dynamically allocated variables.

Procedures

They are u64 values designated to handle the in-memory address of the subroutine's entry points.

Polymorphic variables

...

Overload sets

...

Arrays

They are the simplest collection type and are meant to store a series of variables of the same type.

Strings

They are specialized array designated to handle a series of UTF8 16 bit characters.

Structs

They are data aggregation types that can store variables of different types together.

Any

Any type can be used at runtime to handle different variables and manage code behavior accordingly with the variable's actual type.

Null

An invalid undefined memory address.

void

The return type of the procedures or functions that don't return any value.

Type

In Jai the type is a type itself and maps to a Type_Info struct.

Code

...

Types, constants and variables

  • Variables and assignments
  • Language data types
  • Simple user-defined data types
  • Expressions and operators
  • Type-casting
  • Pointers

Flow control

Procedures and functions

  • Declarations
  • Arguments / Parameters
  • Return values
  • Overloading / Polymorhism
  • Advanced features
  • Lambdas

Aggregated data types

  • Arrays
  • Strings
  • Composition of Structs

Advanced features

Clone this wiki locally