Skip to content

Toolchain

torvik-lang edited this page Jul 30, 2026 · 6 revisions

Torvik Toolchain

Torvik comes with two main command-line tools:

  • torvc — the compiler (turns .tv files into native executables)
  • rune — the project and build tool (recommended for most development)

Both tools are themselves written in Torvik (self-hosting), and behave identically on Linux and Windows.


torvc — the compiler

Use torvc to compile individual files:

torvc hello.tv -o hello     # Compile to executable "hello"
./hello

On Windows, output is a .exe:

torvc hello.tv -o hello.exe
.\hello.exe

Useful flags

Flag Purpose
-o <name> Set the output executable name
--final Production build (optimized + stripped)
  • --no-warn — suppress compile warnings (never fatal; -q implies it; !@NO_WARN; at the top of a file does the same per-file) | -q / --quiet | Suppress the success message | | -v / --verbose | More detailed output | | --version | Show the Torvik version |

Important

You need clang on your PATH. On Windows it must be a clang that bundles the MinGW-w64 headers/libraries (LLVM-MinGW, MSYS2, or WinLibs) — plain LLVM alone lacks the C headers. torvc checks for this and gives an actionable message if it's missing.


rune — the project tool (recommended)

rune is the best way to work on real projects. It handles project creation, building, running, and keeping Torvik up to date.

Since v1.5.0, torvc file.tv runs a file directly (compile, execute, no binary left behind), and any arguments after it reach the program via args_get. rune run file.tv [args...] does the same. For systems work, torvc --bare produces a freestanding image — see Forge your first kernel.

Since v1.5.0, rune update keeps you on your current major and reports a new one rather than installing it (rune update v2 --yes opts in; --silence-major quiets the notice). The standard library has its own repository and version line, gated the same way with rune update --std-major.

Since v1.4.0, rune lives in its own repository (torvik-lang/rune) and versions independently. It still installs alongside torvc and manages Torvik exactly as before; rune version reports its version and the language/std versions.

Creating a project

rune new myapp      # Creates a new project directory
cd myapp
rune run            # Build + run (or use `rune build` to just build)

A new project has this structure:

  • torvik.rune — the project manifest
  • src/main.tv — the entry point (df main())

The manifest can declare a minimum Torvik version; rune build/run will refuse to build with an older toolchain and point you at rune update:

name = "myapp"
torvik = "1.1.0"

Main commands

Command Description
rune new <name> Create a new project
rune init Initialize a project in the current directory
rune run Incrementally build and run
rune build Build the project
rune build --final Production build (optimized + stripped)
rune clean Remove build artifacts
rune list Show project information
rune update Update the Torvik toolchain (see below)
rune self-update Update just rune itself, from its own repo
rune version Show versions
rune uninstall Remove Torvik completely
rune help Display all commands / the help section

Note

rune run is incremental — subsequent runs are very fast if nothing changed.

Updating

rune update          # update to the latest release
rune update v1.1.1   # pin an exact release
rune update v1.1     # newest 1.1.x
rune update v1       # newest 1.x
rune self-update     # update just rune, not the toolchain

A bare rune update first checks whether you're already on the latest release. If the latest is a new major version, it warns about possible breaking changes and asks you to confirm. --yes skips the prompt; --force reinstalls even if you're already current. A pinned version that doesn't exist fails cleanly without touching your current install.

Since v1.4.0, rune and Torvik live in separate repositories, so rune update checks each independently and updates whichever has moved. Use rune self-update to update only rune.

Uninstalling

rune uninstall removes Torvik completely — it takes the Torvik entry back out of your shell startup files and deregisters the .tv file type and icons. Startup files that never had a Torvik entry are left untouched.

Production builds

Use --final for release binaries:

rune build --final
# or
torvc main.tv -o myapp --final

This enables maximum optimization and strips debug symbols.


Next Steps

Clone this wiki locally