Repository navigation
Getting Started
Welcome! This guide will help you install Torvik and run your first program.
- 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).
-
clanginstalled — 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
PATHworks:- LLVM-MinGW (simplest, self-contained)
- MSYS2:
pacman -S mingw-w64-clang-x86_64-toolchain - WinLibs
The easiest way to install Torvik is the one-line installer:
curl -fsSL https://raw.githubusercontent.com/torvik-lang/torvik/main/linux/install.sh | shiwr -useb https://raw.githubusercontent.com/torvik-lang/torvik/main/windows/install.ps1 | iexThe installer will:
- Download the latest release
- Place
torvc(the compiler) andrune(the project tool) in your Torvik home (~/.torvikon Linux,%USERPROFILE%\.torvikon 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 ~/.bashrcVerify the installation:
rune versionUse the rune tool to create and manage projects:
# Create a new project
rune new hello_torvik
cd hello_torvik
# Build and run it
rune runThe quickest way to try something is to let torvc run it — compile, execute, and
clean up, with no binary left behind:
torvc hello.tvAnything after the filename is passed to the program, where args() and args_get(i)
read it:
torvc scan.tv report.csvYou 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
./helloOn Windows, the compiler emits a .exe:
torvc hello.tv -o hello.exe
.\hello.exerune can update the toolchain in place:
# Update to the latest release
rune updateYou 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.xA 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.
- Read the Language Guide to learn Torvik syntax and features
- Explore the Toolchain page for more on
torvcandrune - Check out the Standard Library reference
- Join the discussion on GitHub Discussions