Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.

Getting started

Install Vary

One command installs the varyup toolchain manager and the latest Vary compiler.

Linux / macOS:

curl -fsSL https://github.com/ccollicutt/vary/releases/latest/download/install.sh | sh

Windows (PowerShell):

irm https://github.com/ccollicutt/vary/releases/latest/download/install.ps1 | iex

After running the installer, add ~/.vary/bin (Linux/macOS) or %LOCALAPPDATA%\vary\bin (Windows) to your PATH. See the platform guides below for the exact command.

Restart your shell, then verify:

vary --version

For manual install steps or options, see the platform guides: Linux, Windows, macOS.


Your first program

Create a file called hello.vary:

print("Hello, world!")

Run it:

vary run hello.vary

Vary runs top-level code directly. No main function needed.

A slightly bigger example

def greet(name: Str) -> Str {
    return f"Hello, {name}!"
}

let message = greet("Vary")
print(message)

Functions use def, types go after the parameter name, and blocks use braces.

Project structure

Create a new project with:

vary new my-project

This generates:

my-project/
  .vscode/
    tasks.json
  src/
    main.vary
  test/
    main_test.vary
  vary.toml
  README.md
  .gitignore

The vary.toml file configures your project name, source directories, test settings, and mutation testing policy. The .vscode/ directory includes pre-configured build, test, format, and mutate tasks.

To include a Dev Container configuration, pass --devcontainer:

vary new my-project --devcontainer

This adds a .devcontainer/devcontainer.json so anyone who clones the project can open it in VS Code and start working immediately.

Common commands

vary run src/main.vary           # compile and run
vary check src/main.vary         # type-check without running
vary test test/                  # run all tests in a directory
vary test test/main_test.vary    # run a single test file
vary fmt src/                    # format source files
vary mutate src/main.vary --tests test/main_test.vary  # mutation testing

Running tests

Vary has a built-in test runner. Write tests with the test block syntax:

test "greet includes the name" {
    observe greet("Alice") == "Hello, Alice!"
}

Run them:

vary test test/main_test.vary

Writing Vary with LLMs

LLMs don't have training data on Vary, but we ship an LLM skill that gives AI coding assistants the full language reference (grammar, types, stdlib, and toolchain commands). With the skill loaded, tools like Claude Code write valid Vary code without falling back to Python habits.

The skill is bundled in every Vary installation at llm-skill/. To use it, point your AI coding tool at that directory. See Writing Vary with LLMs for setup details.

Next steps

TopicWhat you'll learn
VS CodeDev Container setup, LSP features, configuration
Writing Vary with LLMsUsing AI coding tools with Vary
Syntax overviewHow the language works
TypesVary's type system
TestingThe test runner and mutation testing