IRIS/IRIS++ | Game Development Programming Language

Top Top | Previous Prev | Next Next

Using The Compiler


Plain IRIS/IRIS++ programs are compiled to byte code by going through a conversion process called compile. In the compiling phase, Each program statement is broken down into small tokens so that each token is represented as 1 byte. Each byte is added with a special ID (which is also represented with 1 byte) so that during execution, the Virtual Machine knows whether the code it is looking at is an instruction, value, or register.

IRIS/IRIS++ programs are compiled using a compiler called IRISC. IRISC is bundled with many useful libraries you could include in your programs. Also, IRISC can be tuned up using special compile-time modifiers. See Using The Macro for more information on compile-time modifiers. In this section, we will show you how to set up an environment for compiling a program and represent you with a "Hello, World!" demo.

Setting Up The Environment

First of all, download IRIS/IRIS++ from the download page and unzip all contents to your local C: drive. You should be facing the following directory structure.

IRIS directory structure

The iris/bin directory stores all your binaries and setting files, including: the IRISC compiler (irisc.exe), Virtual Machine (ulyvm.exe), Makefiles, and the data directory to store your compiled code and resources. The iris/data/script directory stores all your source code with bundled library files in the lib directory.

The compile source directory (iris/data/script) must be same as the Virtual Machine executable binary directory structure (iris/bin/data/script). This is because the #include keyword must be synchronized during compile and execution time.

To run the compiler, you will need .Net Framework (2.0 or above) installed on your PC with Windows 2000 or above. The Virtual Machine requires DirectX 9 or above installed.

Running Your First Program

We will run a simple "Hello, World!" program by compiling and executing the Virtual Machine. First of all, run the make.bat batch file located under the bin directory. The output should look like this:

Hello, World!

The batch file simply cleans the output directory, compile the source files and executes the Virtual Machine. Following is the content of make.bat.

cd C:\
cd C:\iris\bin

del /Q C:\iris\bin\data\script\*.*
del /Q C:\iris\bin\data\script\lib\*.*

irisc C:\iris\data\script C:\iris\bin\data\script



If you cannot see the "Hello, World!" screen, make sure you have your unzipped iris folder located directly under your local C: drive, or modify the paths in the make file to suit your own environment.

The compiler (irisc.exe) arguments are:

irisc [source code directory] [output directory] [-i (output intermediate code)]