LEARN VOID

Running and building applications

Install a matching source build, then check, run or compile the same application.

cartons.voidDownload source
func entry(bottles: i32) -> i32:
    # Each full carton holds four bottles.
    return bottles / 4
Input 8Expected result 2

Start with source installation and platform prerequisites. Use voidc --help, voidc --version and voidc build --help to inspect the installed compiler and command examples.

Choose the entry point

Run voidc run main.void for a synchronous application. A zero-argument main can return a process status. Entry selection is automatic; the removed --app option is rejected. Executable top-level statements can also form an application. File-level globals initialize before the selected entry runs.

Try the numeric adapter

The small program on this page uses entry(i32) -> i32. voidc run cartons.void 8 prints its returned integer. An application returning status 2 does not print the number 2.

Build and check

Use voidc check . for diagnostics, voidc build . -o app to link an executable, or voidc emit main.void -o main.o for an object. The LLVM/Clang/LLD 23.1.4 toolchain shares lowering between JIT and native output. Keep the compiler’s matching Runtime, installed standard sources and native resource manifests together. Native builds still need the original SDK and platform development libraries. Quote output paths containing spaces. Without an output override, build writes build/main for main.void (build/main.exe on Windows).

O2 is the default. run --no-opt selects unoptimized code; run --cache selects Debug code and reports cache status. run --no-cache disables disk caching without disabling O2. Invalid invocations exit 2, compiler/toolchain failures exit 1, and applications return their own process status.

Continue learning with Editor tooling.