Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variables

Variable declarations are extremely simple. Simply pick a variable type and identifier, then set it to a value.

int x = 20;

important

You cannot defined a variable with no value, for example: int x; is not valid syntax. However, variables are treated as mutable, so to achieve the same effect just initialize the variable with dummy data.

Currently the supported types in KSL are:

TypeIdentifierSize (Bits)
int8i88
int16i1616
int32i3232
int64i64 || int64
float32f3232
floatf64 || float64
boolbool1
nullnullN|A
voidvoidN|A

note

KSL is designed for programmers of all skill levels. Some programmers might not care (or know) about int's of different sizes, so int and float are aliases for the largest supported int and float types. It makes it easier for beginners to understand and it's more readable for simple projects that don't need to worry about tight memory constraints.

warning

Documentation incomplete, pulled from unfinished ksl/ksl_syntax.md file.