Reserved identifier names

Unlike many other languages, Jai tries to achieve a lot by leveraging compile-time typechecking and focusing on solving hard problems, rather than simply adding syntax sugar that solves easy problems. That’s why the list of reserved keywords is rather short.

Keywords Purpose
bool, true, false booleans howto
int, s8, u8, s16, u16, s32, u32, s64, u64 integers
float, float32, float64 float point numbers
void
enum, enum_flags enums howto, enum unary dot howto
struct, using, union
string strings howto, Strings and String Manipulation
type_of, cast types howto
if, ifx, then, else, case If statements, Case Branching
for, while, break, continue
return
defer
inline A guaranteed inline
remove
xx Auto-cast

Gotchas

  • The following identifiers are not reserved: function, assert, exit.
  • it and it_index are available in loops, but are not reserved either.