index


welcome to jaimanual

I'm going to put random content here, and then filter it into files as we go

building your first program

Before we get started, know that jai knows about jai, and we can use jai to compile our program written in jai. This is different from c++ where you have to use an external build tool to compile.

Compile Time

Compile time is the phase when source code is translated into executable code by a compiler. During this stage, syntax errors, type errors, and other issues that can be detected without running the program are identified and reported.

Note that compile time is the time before compilation is complete.

Run Time

Run time is the phase when a program is executed after it has been successfully compiled. During this stage, the program performs its intended tasks, and errors related to logic, input, or system resources may occur.

Additionally we can specify code we'd like to run at compile time.

is_constant

A given value satisfies is_constant iff it's value during runtime is always the same.

#run

Executes the following expression at compile time. Note that the result of any #run expression satisfies is_constant

#insert

Given a string it directly puts it into the code before compilation.

typeof

Suppose we have defined a struct called My_Struct. If we instantiate a variable that holds a struct like this v : My_Struct. Then if you do typeof(v) the type will be My_Struct, whereas typeof(My_Struct) is Type. Interestingly this would mean that type_of(type_of(v)) is Type instead of My_Struct, which is what you might expect

opengl

Note that you must create a window before interacting with any opengl functions.

switch statements

    
 if var == {
        case valA;
            ..;
        case valB;
            ..;
        case; // default case
            ..;
    

~

directories

files

other files