News

READABLE CODE, CHECKABLE TESTS.

vary

A readable, statically-typed programming
language that measures test strength.



Install the toolchain manager and latest compiler. Full install docs →

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

Features

Why varylang

A lie detector for tests

Tests can lie. Mutation testing exposes the ones that do. vary mutate shows which tests are weak, which mutations survived, and exactly what to fix.

Contracts and assertions

Contracts (in / out) declare what a function expects and what it promises. observe assertions check behaviour at runtime. Both are part of the language itself.

One CLI for the entire workflow

Run, check, test, format, and mutate from a single binary. Everything ships with the compiler. No plugins or extra tools required. Get started in minutes.

Fast JVM execution

Vary compiles to JVM bytecode and runs on any JVM. Mutation testing uses bytecode patching, so mutants run without recompiling.

See it in action

What Vary looks like

Testing is part of the language

Test blocks and observe assertions are normal Vary code. Put the checks beside the functions they protect.

Readable syntax

Vary keeps the plain shape developers like in Python and adds static typing plus compile-time checks. No semicolons, no ceremony.

Mistakes caught before runtime

Static typing, null safety, and compile-time analysis catch common errors before the program runs. The code stays compact.

Core ideas

What makes Vary different

Formal verification

Tests check the inputs you tried.
Proofs check all of them.

The in and out contracts you already write can be proved by vary prove. It reasons about the function for every possible input, and when a promise fails it gives you the exact input that breaks it. The solver ships with the compiler, so there is nothing to install.

def abs_diff(a: Int, b: Int) -> Int {
    out(r) {
        r >= 0
    }
    if a > b {
        return a - b
    }
    return b - a
}
$ vary prove --bounded abs_diff.vary
abs_diff  overflow in `a - b`   REFUTED
  a = 0
  b = -9223372036854775808

Every ordinary test of abs_diff passes. The prover finds the one input where the subtraction wraps around and the result goes negative.

Explore formal verification → Write your first proofs Take the course

Ecosystem

Build, test, and ship with the same tools

From the blog

Articles

Learn

Courses

Start with a guided path instead of a blank file. Each course is a series of short lessons you can run, with the expected output shown so you can check your own.

Install Vary with Docker Get Vary running locally with Docker, verify the compiler, and run a first file from your working directory. Work through it in order, run the examples, and check each result before moving on. Docker setup 3 lessons
Vary Introduction Ten short programs that show what Vary is for: typed code, pure boundaries, contracts, and tests strong enough to survive mutation. Work through it in order, run the examples, and check each result before moving on. Why Vary exists Language choices Workflow 10 lessons
Language Tour Thirteen runnable lessons covering typed values, functions, readable blocks, data, state, enums, dictionaries, nullable values, modules, and tests. Work through it in order, run the examples, and check each result before moving on. Values, functions, control flow Modeling data Lookups and modules Tests 13 lessons
Vary Testing Seven runnable lessons covering `test`, `observe`, edge cases, error paths, output, and naming. Work through it in order, run the examples, and check each result before moving on. First tests Edge cases and errors Running and reading 7 lessons

Vary: It's very good

Start Exploring

Install the toolchain manager and the latest compiler.

Install Vary →