The kova command
Everything goes through one command:
| Command | Does |
|---|---|
kova run app.kova [words…] | checks the program and runs it at once; the words become its system.args |
kova build app.kova | makes a native executable next to the file |
kova test app.kova ["name"] | runs the program’s test blocks, or only the one named |
kova fmt app.kova… | lays the files out the standard way, in place |
kova app.kova | does what the program’s header says, run by default |
kova lsp | the language server, started by the editor |
kova debug | the debugger, started by the editor |
kova --version | Kova’s version |
Every command reads the files the program imports by itself. There is no project file.
kova build
Section titled “kova build”| Option | Does |
|---|---|
-o name | names the executable (default: the header’s name, else the file’s name; .exe added on Windows) |
--boost | leaves the contracts (require, ensure, check) out, for speed |
--target system | builds for another system (below) |
When it is done, it says what it made, for which system, and how long it took:
✓ app (Linux, 29 KB) in 3 msThe executable needs nothing installed to run, apart from GTK 4 on Linux for a program with
windows and OpenSSL on Linux for https://. Kova writes it entirely itself: no C compiler, no
linker, no SDK, on any system.
Targets
Section titled “Targets”From any system, --target builds for any other:
| Target | For |
|---|---|
linux | Linux on x86-64 (Intel, AMD) |
linux-arm | Linux on arm64 (Raspberry Pi 4 and later, ARM servers) |
windows | Windows on x86-64 |
windows-arm | Windows on arm64 |
mac | every Mac, in one file (Apple chips and Intel); the default on a Mac |
mac-arm | Macs with an Apple chip only |
mac-intel | Intel Macs only |
web | one .html file that runs in a browser (Kova in a web page) |
android | one signed .apk for phones and emulators (Kova on Android); android-arm, android-intel hold one processor |
ios-simulator | an .app folder for Xcode’s iPhone and iPad simulator (Kova on iOS) |
Each target needs a small piece of Kova compiled for it, added to Rust before installing Kova
(Installing); kova build says which one is
missing otherwise.
kova search
Section titled “kova search”kova search json lists the packages of the index that hold every word given, each with its newest
version and the import line to copy; kova search alone lists them all (20 at most). It needs
git. See Finding and publishing a package.
kova install
Section titled “kova install”kova install counter.kova builds the program and installs it for you, where your system looks
for programs. kova uninstall counter.kova removes everything it wrote. Nothing needs
administrator rights.
| System | The program | With windows, also |
|---|---|---|
| Linux | ~/.local/bin/<name> | a .desktop file and the icon in ~/.local/share: the program is in the applications menu, with its icon in GNOME, KDE and the others |
| Mac | ~/.local/bin/<name> | instead, ~/Applications/<name>.app: Launchpad, the Dock and the Finder show it with its icon |
| Windows | %LOCALAPPDATA%\Programs\<name>\<name>.exe | a shortcut in the Start menu |
<name> is the header’s name, else the file’s name.
kova test
Section titled “kova test”Runs each test block of the file on its own, and writes ✅ or ❌ with the message of the first
broken check (Contracts and tests). kova test counts as
kova run for mode.
kova fmt
Section titled “kova fmt”Lays the code out the standard way: indentation and spaces. A line wider than 100 characters is cut at its commas, each element of the call, list or struct on a line of its own, and a list of numbers or texts only as much as it needs. It never joins lines, so a shape you chose yourself stays. It refuses to change a file if the result would not mean exactly the same program. The editor runs it on save.
Exit codes
Section titled “Exit codes”| Code | Means |
|---|---|
0 | the program ended normally |
1 | Kova refused the program (an error in the code), or a test failed |
101 | the program stopped on an error while running: an index out of bounds, an overflow, a broken contract… |
| other | what the program gave to system.exit(code) |
A built executable ends with the same codes.