Docs · Toolchain

Getting started

Get a working vyi toolchain, then write a first program. Prefer the install script on linux; build from source if you are hacking on the compiler. For day-to-day CLI usage see the Tooling guide and the CLI reference.

Vyi is early alpha. Prebuilt artifacts target linux/amd64 and linux/arm64 today.

Install

The repository ships scripts/install.sh. It downloads the CI-published binaries and standard library and installs them under ~/.local by default:

sh
curl -fsSL https://forgejo.roberthurst.ca/robert/Vyi/raw/branch/master/scripts/install.sh | bash

The script prints a short splash (with color when the terminal supports it), then installs. To remove what it installed:

sh
curl -fsSL https://forgejo.roberthurst.ca/robert/Vyi/raw/branch/master/scripts/install.sh | bash -s -- --uninstall
# or from a checkout:
./scripts/install.sh --uninstall

What install puts on disk:

PathContents
~/.local/bin/vyicompiler CLI
~/.local/bin/vyi-language-serverlanguage server (editors, playground)
~/.local/share/vyi/standard library ($PREFIX/share/vyi)

Make sure the bin directory is on your PATH:

sh
export PATH="$HOME/.local/bin:$PATH"

Then check the install:

sh
vyi help

Options

VariableDefaultMeaning
PREFIX$HOME/.localinstall root (bin/ under this)
VYI_VERSIONlatestpackage version: latest (builds from master) or a tag such as v0.1.0
VYI_INSTALL_BASEForgejo generic package URLoverride the artifact base if you mirror releases
VYI_OWNERrobertForgejo package owner (only if you fork the publish path)

Examples:

sh
# system-wide (needs write access to PREFIX)
PREFIX=/usr/local curl -fsSL …/install.sh | bash

# pin a tagged release (once tags exist)
VYI_VERSION=v0.1.0 curl -fsSL …/install.sh | bash

# from a local clone
./scripts/install.sh
PREFIX=/opt/vyi ./scripts/install.sh
./scripts/install.sh --uninstall

The script needs curl, tar, and a normal linux userspace. It refuses non-linux hosts and architectures other than amd64/arm64. Color follows NO_COLOR / VYI_FORCE_COLOR (same idea as the CLI).

Where artifacts come from

CI publishes to the Forgejo generic package registry:

text
https://forgejo.roberthurst.ca/api/packages/robert/generic/vyi/<version>/
  vyi-linux-amd64
  vyi-arm64-linux
  vyi-language-server-linux-amd64
  vyi-language-server-arm64-linux
  vyi-stdlib.tar.gz

<version> is latest for pushes to master, or a git tag name for tagged builds. The install script picks the pair that matches your machine and unpacks the stdlib tarball into $PREFIX/share/vyi (default ~/.local/share/vyi), which is where the compiler looks for @-packages.

Build from source

You need Go (the version pinned by bootstrap-compiler/go.mod) and a C compiler on PATH if you will link native (x86-64-linux / arm64-linux) binaries.

sh
git clone ssh://[email protected]:1122/robert/Vyi.git
cd Vyi

# compiler CLI
( cd bootstrap-compiler && go build -o vyi ./cmd/vyi )

# language server (optional; editors and the website use it)
( cd bootstrap-language-server && go build -o vyi-language-server . )

Point the CLI at the in-tree standard library while developing:

sh
export VYI_STDLIB_PATH="$PWD/packages"
# or pass --packages on each invocation:
./bootstrap-compiler/vyi run --packages packages path/to/main.vyi

Without VYI_STDLIB_PATH / --packages, the binary also probes ../packages next to itself and ./packages relative to the current directory, so running from a checkout often just works.

Verification gate

From bootstrap-compiler/:

sh
go build ./...
go test ./... -count=1
go test ./transform/ -run Test_Transform_E2E_Native -count=1

Installing a source build yourself

There is no separate make install. Copy the binaries somewhere on PATH and keep the packages tree where the compiler can find it (for example under ~/.local/share/vyi, matching the install script layout):

sh
install -m 0755 bootstrap-compiler/vyi ~/.local/bin/vyi
install -m 0755 bootstrap-language-server/vyi-language-server ~/.local/bin/vyi-language-server
mkdir -p ~/.local/share/vyi
cp -a packages/. ~/.local/share/vyi/

Hello, world

Once vyi is on your PATH:

vyi
import { stdout } from "@io"

fn main() !u8 {
    stdout.write("hello, world\n")
    return Ok(0)
}
sh
vyi run hello.vyi

Then follow the guides in order, or jump into the playground on this site.

Next steps