Skip to content

Getting Started

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

Getting Started with Torvik

Welcome! This guide will help you install Torvik and run your first program.

Prerequisites

  • A supported operating system: Linux (x86_64) and Windows (x86_64) are both fully supported. macOS is not yet supported (planned for a future version once real Apple hardware is available for testing).
  • clang installed — Torvik uses it as the linker and LLVM backend.

Install clang:

  • Ubuntu/Debian: sudo apt install clang
  • Solus: sudo eopkg install clang
  • Windows: you need a clang that bundles the MinGW-w64 headers/libraries (plain LLVM alone lacks the C headers). Any one of these on your PATH works:
    • LLVM-MinGW (simplest, self-contained)
    • MSYS2: pacman -S mingw-w64-clang-x86_64-toolchain
    • WinLibs

Installation

Linux

The easiest way to install Torvik is the one-line installer:

curl -fsSL https://raw.githubusercontent.com/torvik-lang/torvik/main/linux/install.sh | sh

Windows (PowerShell)

iwr -useb https://raw.githubusercontent.com/torvik-lang/torvik/main/windows/install.ps1 | iex

The installer will:

  • Download the latest release
  • Place torvc (the compiler) and rune (the project tool) in your Torvik home (~/.torvik on Linux, %USERPROFILE%\.torvik on Windows)
  • Add Torvik to your PATH
  • Install the runtime and standard library

After installation, open a new terminal (so the PATH change takes effect), or on Linux run:

source ~/.bashrc

Verify the installation:

rune version

Creating your first project

Use the rune tool to create and manage projects:

# Create a new project
rune new hello_torvik
cd hello_torvik

# Build and run it
rune run

Running a single file

The quickest way to try something is to let torvc run it — compile, execute, and clean up, with no binary left behind:

torvc hello.tv

Anything after the filename is passed to the program, where args() and args_get(i) read it:

torvc scan.tv report.csv

Compiling a single file

You can also compile individual .tv files directly with the compiler:

# Create a simple program
cat > hello.tv << EOF
df main() -> void {
    echo!("Hello from Torvik!");
}
EOF

# Compile and run
torvc hello.tv -o hello
./hello

On Windows, the compiler emits a .exe:

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

Updating Torvik

rune can update the toolchain in place:

# Update to the latest release
rune update

You can also pin a version:

rune update v1.1.1   # an exact release
rune update v1.1     # the newest 1.1.x
rune update v1       # the newest 1.x

A bare rune update first checks whether you're already on the latest release and tells you if so. If the latest is a new major version, it warns you about possible breaking changes and asks you to confirm before updating. Use --yes to skip the prompt and --force to reinstall even if you're already current.

Next Steps

Clone this wiki locally