Kinal

What is Kinal?

Kinal is an open-source, statically typed language for application and systems development. It supports native compilation with LLVM, bytecode execution with KinalVM, and C interoperability.

Basic syntax

Source files use the .kn extension. Unit declares a module and Get imports a dependency. This program prints a line to the console.

hello.kn
Unit App;

Get IO.Console;

Static Function int Main()
{
    IO.Console.PrintLine("Hello, World!");
    Return 0;
}
Hello World tutorial

Compilation and execution

The LLVM backend produces native executables. The KinalVM backend produces KNC bytecode for the virtual machine to interpret.

Compile and run natively
kinal run hello.kn
Run with KinalVM
kinal vm run hello.kn

The backends do not support every feature equally. Check the support table before choosing one.

Backend support table

C interoperability

Declare C functions with Extern and function-pointer signatures with Delegate. Calls must follow the library’s ABI, parameter types and memory-management rules.

FFI reference

Standard library and tools

kinal.knproj configures source sets and build options. Standard packages provide console, file, text and network interfaces.

Project configurationStandard library reference