Skip to content

The kova command

Everything goes through one command:

CommandDoes
kova run app.kova [words…]checks the program and runs it at once; the words become its system.args
kova build app.kovamakes 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.kovadoes what the program’s header says, run by default
kova lspthe language server, started by the editor
kova debugthe debugger, started by the editor
kova --versionKova’s version

Every command reads the files the program imports by itself. There is no project file.

OptionDoes
-o namenames the executable (default: the header’s name, else the file’s name; .exe added on Windows)
--boostleaves the contracts (require, ensure, check) out, for speed
--target systembuilds for another system (below)

When it is done, it says what it made, for which system, and how long it took:

Terminal window
✓ app (Linux, 29 KB) in 3 ms

The 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.

From any system, --target builds for any other:

TargetFor
linuxLinux on x86-64 (Intel, AMD)
linux-armLinux on arm64 (Raspberry Pi 4 and later, ARM servers)
windowsWindows on x86-64
windows-armWindows on arm64
macevery Mac, in one file (Apple chips and Intel); the default on a Mac
mac-armMacs with an Apple chip only
mac-intelIntel Macs only
webone .html file that runs in a browser (Kova in a web page)
androidone signed .apk for phones and emulators (Kova on Android); android-arm, android-intel hold one processor
ios-simulatoran .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 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 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.

SystemThe programWith 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>.exea shortcut in the Start menu

<name> is the header’s name, else the file’s name.

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.

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.

CodeMeans
0the program ended normally
1Kova refused the program (an error in the code), or a test failed
101the program stopped on an error while running: an index out of bounds, an overflow, a broken contract…
otherwhat the program gave to system.exit(code)

A built executable ends with the same codes.