# Lisaac Ω – Examples
This directory contains example programs written in Lisaac Ω. Source files are always named with the `.li` suffix.
Although these files can be opened with any text editor, it is strongly recommended to view them with the editor named `elit`.
Even though `.li` files look like plain source code, they are not formatted for readability in standard editors,
especially regarding graphical operators.

Moreover, `elit` provides syntax highlighting for type names and method selectors, which quickly becomes essential for
understanding and progressing in Lisaac Ω.

There are essentially two indispensable tools: `elit` and `lisaac`.

The `elit` command is the source code editor and viewer. The `lisaac` command is the compiler for the Lisaac Ω language.
To view the code of a program, open a terminal, move to this directory and run, for example:

elit hello_world.li

Unlike the compiler, the `elit` command requires the full filename, including the `.li` suffix.
The naming convention in Lisaac Ω is that object files on disk use lowercase names, while their corresponding type names in
the source code are written in uppercase. For example, the file `hello_world.li` contains the definition of the type `HELLO_WORLD`.

To compile and run a program, still from this directory, type:

lisaac hello_world.li

or equivalently:

lisaac hello_world

The program file must contain a public method named `main` without any argument. This method indicates the starting point of the program.
Once `main` is found, the compiler automatically searches and compiles all the code required for execution.
The `lisaac` compiler generates C as a portable intermediate language. Your C compiler (often `gcc` or `clang`) then translates it into
directly executable machine code.

The final executable generated from `hello_world.li` will be named `hello_world` on most systems, or `hello_world.exe` on Windows.

By default, and without any special options, the produced executable contains all possible debugging information. This is convenient,
even essential, during debugging phases. However, it may significantly increase compilation time, especially for large programs.

A very useful compilation option is `-boost`. Adding this option at the end of the command line produces a much smaller and faster executable:

lisaac hello_world -q -boost

During development, to inspect the stack in case of a problem, it is better to avoid the `-boost` option. To list all available compiler options, use:

lisaac -help

After compilation, you can run the program with:

./hello_world
or, on Windows:
./hello_world.exe

Each example file contains a comment block at the top, which should be read before running or modifying the program. This header usually describes the
purpose of the example and how it works.

To explore the language step by step, we suggest starting with:
- lisaac/example/hello_world.li
- lisaac/example/print_args.li
- lisaac/example/fibonacci.li
- other examples in lisaac/example/*.li

After these first simple examples, we suggest continuing with larger programs that are each located in their own directory:
- lisaac/example/welcome/welcome.li
- lisaac/example/startrek/startrek.li
- lisaac/example/connect_four/connect_four.li
- lisaac/example/tetris/tetris.li

