A custom programming language aiming at the simplicity of C with the power of C++, Rust and Go.
The compiler currently parses only a small subset of the language and does some basic typechecking on it.
The code generator currently generates C.
Usage: ./ilc [options] file
Options:
--help, -h Print this help.
--dump-ast, -d Dump the parsed and validated AST.
--dump-tokens, -t Dump the scanned tokens.
The compiler currently compiles by default a file called test.ilc in the current directory.
To make sure no regressions occur, there are tests for every major feature & almost all errors.
The tests are compiled and their output compared to the expected one by the tester program.
Note that the tests do not cover the whole language yet. Also note that some tests were written
for fixed bugs in older iterations of the compiler, and so will seem weird and unnecessary.
To run the tests, the tester program must first be compiled.
To do so, execute the following from the root of the repository:
cd compiler/tester
g++ tester.cpp -Wall -Wextra -Werror -o testerNow the tests can be run by executing the tester program in the same folder like this:
./tester-
The
testerprogram is currently written in (not very good) C++.
The plan is to rewrite it in itai-lang as soon as the compiler is able to compile enough of the language for it to be usable. -
The
testerprogram expects the compiler executable to be namedilcand to be present in the<repo_root>/compiler/buildfolder (<repo_root>represents the path to the repository).
This also means that thetesterprogram can only be run from thecompiler,compiler/build, &compiler/testerfolders. -
The
testerprogram runs all files in the current folder with the extension.ilc.
Each test must have the following as the first line:/// expectfollowed by eithersuccess, orerror:followed by the expected error message.
The full spec for the language is here, it isn't final yet.
A new and improved spec is being written, it can be found here.