A simple programming language that compiles into x86 assembly.
- CMake (>= 3.15)
- GCC
# From the project root:
mkdir -p build/debug && cd build/debug
cmake -DCMAKE_BUILD_TYPE=Debug ../..
cmake --build .
# For release build:
cd ../..
mkdir -p build/release && cd build/release
cmake -DCMAKE_BUILD_TYPE=Release ../..
cmake --build .
The compiler executable (ikac
) will be placed in build/<cfg>/bin/
.
The project currently supports Windows builds using the MinGW toolchain. You need a 32-bit MinGW gcc.
REM From the project root:
mkdir build\debug
cd build\debug
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ../..
cmake --build .
REM For release build:
cd ..\..
mkdir build\release
cd build\release
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ../..
cmake --build .
The compiler executable (ikac.exe
) will be placed in build/<cfg>/bin/
.
# From any build directory:
ctest --output-on-failure
# Run only the 'basic' tests:
ctest -L basic
Usage: ikac [options] file
Options:
-E Preprocess only; do not compile, assemble or link.
-S Compile only; do not assemble or link.
-o <file> Place the output into <file>.
-e <entry> Specify the program entry point.
-D <macro> Define a <macro>.
-I <dir> Add <dir> to the end of the main include path.
-? Display this information.
"Hello world!\n";
// Fibonacci sequence using recursion
fn fib(n: i32) i32 {
if (n <= 1) {
return n;
}
return fib(n - 1) + fib(n - 2);
}
fn main() void {
var i: i32 = 0;
while (i < 10) : (i += 1) {
"%d\n", fib(i);
}
}
See more examples in the examples
and tests
folder.
See the ika Language Documentation