KriolLang or Kriol is a programming language based on the Cape Verdean Creole. It was made to be easy for anyone who understands Cape Verdean Creole while keeping the same versatility as some other languages, such as C, Go, and Rust.
fn ola(textu nomi, bool naKriolu) {
si naKriolu {
mostran(f"Olá {nomi}, ami nta programa na Kriolu!");
} sinon {
mostran(f"Hello {nomi}, I program in Kriol!");
}
}
fn inisiu() {
ola("Visitanti", sin);
ola("Guest", nau);
}
The syntax of this programming language was initially based on C, Go, and Rust, but other programming languages such as Liquid played a good role in the initial design.
For more concrete specifications about the language, you are recommended to read the KriolLang Language Documentation.
The file extension of the KriolLang programming language is .kriol or .kr and the name of the lang's compiler is kriol.
The easiest way to test it currently is using a linux-based OS (if you're on Windows I would recommend trying it inside WSL), and as a dependency at least make sure to have a cc linker available like gcc or clang to ensure proper linkage of the produced object file .o into the binary code required to run in the system.
You can install it using the following command:
curl -fsSL https://raw.githubusercontent.com/kriol-lang/kriol/refs/heads/main/install.sh | sh -s -- --preAfter that add the following to your shell env:
export PATH="$HOME/.kriol:$PATH"Then close and reopen the shell and try kriol --version.
The first thing to do after compiling the compiler is to execute the help command:
kriol --helpAfter executing that command you may see the usage section and some of its options.
An example of how it could be used is to compile one of the example files in the examples folder:
kriol examples/fibonacci_recursive.kriolThis compiles fibonacci_recursive.kriol to a native binary named a.out by default. Use -o to specify a different output name:
kriol examples/fibonacci_recursive.kriol -o fibonacci_recursiveThen execute the compiled binary with:
./fibonacci_recursiveTo inspect the generated LLVM IR instead of producing a binary:
kriol examples/mensage_special.kriol --emit-irSource text can also be compiled directly without creating a source file:
kriol --text 'fn inisiu() { mostran("Kuale, Mundu!"); }' -o helloTo compile a Kriol program to a WASI WebAssembly module:
kriol examples/hello_world.kriol --target wasm32-wasi -o hello.wasmThe generated module is a WASI command module. For a browser playground, run it
through a WASI preview1 JavaScript shim and capture stdout to display
mostra/mostran output.
Native formatted strings use the embedded Boehm GC runtime. The default WASI
configuration currently uses malloc instead: formatted strings are not
reclaimed before process exit, so no-GC WASI output is intended for short-lived
command modules. KRIOL_WASI_ENABLE_GC=ON remains experimental and requires a
Boehm GC checkout with WASI support.
If you want to build the project, currently it only works mostly on Linux based operating systems. It depends mainly on Clang/LLVM 20 and LLD 20 to compile the source code and link user programs, and bison and flex to compile the language rules.
If you are on a Debian (or Ubuntu) based Linux operating system you can install the dependencies using the following command:
apt install make flex bison clang-20 llvm-20 llvm-20-dev llvm-20-tools lld-20 zlib1g-dev libzstd-dev xxd cmakeWASI output also needs the WASI libc and compiler runtime packages:
apt install wasi-libc libclang-rt-20-dev-wasm32WASM support is enabled by default when building kriol. If you want a
native-only compiler with fewer build dependencies, configure with:
cmake -B build -DKRIOL_ENABLE_WASM=OFFAfter installing the dependencies, compile the compiler using:
cmake -B build && cmake --build buildAnd then run with:
./build/kriol --helpFor a release build use:
cmake -B build/release -DCMAKE_BUILD_TYPE=Release -DKRIOL_STATIC=ON && cmake --build build/releaseAnd run with:
./build/release/kriol --helpYou can run tests with the following command:
cmake -B build && cmake --build build --target checkAll the code and specifications of the KriolLang programming language are currently under the MIT License.