Documentation
Learn how to use varylang, from installation to advanced features.
Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.
Introduction |
|
| Introduction | What Vary is and why it exists |
Getting Started |
|
| Getting started | Install Vary and write your first program |
| Syntax overview | A guided tour of Vary's syntax and features |
Language |
|
| Types | Primitives, optionals, function types, and type inference |
| Classes and data types | Classes for mutable state, data types for immutable values |
| Generics | Write type-safe code that works with any type |
| Enums and pattern matching | Fixed variant types with payloads and pattern matching |
| Collections and strings | Lists, dicts, sets, and string operations |
| Error handling | Try/except, Result types, and custom error classes |
| Readable blocks | Grouped bindings and scoped expressions for multi-step work |
| Modules and imports | File-based modules, imports, and package structure |
| Concurrency | Spawn tasks, manage task groups, and handle cancellation |
| Contracts | Preconditions and postconditions on functions |
| Language surfaces | How Vary's importable code and compiler-supported features fit together |
Standard Library |
|
| Built-in functions | Functions available everywhere without imports |
| Standard library | Importable modules for JSON, crypto, filesystem, HTTP, time, process, env, logging, and more |
Testing |
|
| Check rules | Run vary check and find its focused rule and workflow guides |
| Check rules: idioms | Idiomatic Vary rules and examples |
| Check rules: contracts and tests | Contract, test, and mutation readiness rules |
| Check rules: safety and design | Safety, API, structure, and great-code rules |
| Using vary check | Flags, JSON output, repair plans, CI, and auto-fix |
| Testing | Built-in test blocks with observe assertions and property-based testing |
Via |
|
| Overview | High-level overview of Via and the main docs path. |
Installation |
|
| Linux | Install the Vary toolchain on Linux |
| Windows | Install the Vary toolchain on Windows |
| varyup | The toolchain manager that installs and updates Vary |
| Docker | Run Vary in a Docker container |
| VS Code | VS Code extension with syntax highlighting and LSP |
| macOS | Install the Vary toolchain on macOS |
Comparisons |
|
| Python comparison | Side-by-side syntax and semantics comparison with Python |
| Hypothesis comparison | How Vary's across-based property testing compares to Hypothesis for Python |
| Related languages | Languages that influenced Vary's design |
LLMs |
|
| Writing Vary with LLMs | Using AI coding tools to write Vary programs |
| LLM coding checklist | Do-this / don't-do-this rules for LLM coding assistants writing Vary |
About |
|
| Varyonic programming | Varyonic code style and a guide to its design principles |
| Language design choices | Trade-offs and rationale behind language decisions |
| Varyonic decisions | Observable behavior, typed domains, pure logic, and isolated decisions |
| Varyonic guarantees | Errors, contracts, effects, resources, and finite decisions |
| The compiler | How the compiler pipeline turns source into bytecode |
| Performance | Benchmark results comparing Vary to Java and Python |
| Varyonic architecture | Program structure, module layout, and patterns to avoid |
| JVM codegen API | Install and embed the experimental Vary JVM bytecode generator |
| Ecosystem | Tools, extensions, and integrations around Vary |
| Varyonic scripting | A five-phase structure for testable scripts |
| Codegen architecture | The public architecture and artifact flow of the JVM codegen component |
| Codegen security | Threat model, trust assumptions, reporting, and patch policy for JVM codegen |
| What we ship | Distribution formats and what each release includes |
Embedded DSLs |
|
| Embedded DSLs | Compiler-integrated syntax for SQL, HTTP, logging, JSON, and AI workflows |
| HTTP services | Expose interfaces as HTTP services with typed routes |
| SQLite databases | Built-in SQLite support with compile-time typed queries |
| Structured logging | Typed, mutation-aware logging with pluggable sinks |
| Public JSON APIs | Define secure public JSON routes with taint, capabilities, migrations, workers, safe markdown, and versioned contracts. |
| JSON decode | Typed JSON extraction with path-aware errors, validation predicates, and the ? operator |
| Public API security | The trust boundary, validators, sinks, auth, capabilities, audit, and compile-time gates that protect public Vary APIs. |
| Semantic AI control flow | Use ai using, feels, by meaning, and llm with an explicit context |
| Native AI evals | Declare typed AI cases, pure scores, aggregate gates, and bounded fixture or live runs |
Project Management |
|
| Known Issues | Currently known bugs and limitations |
| Versioning | Monotonic channel versioning instead of semver |
Tools and Configuration |
|
| CLI reference | Commands for running, testing, formatting, and building |
| Configuration | Project settings via vary.toml |
| Project layout | Recommended directory structure for Vary applications |
| Example Vary programs | Download small complete Vary programs as source zips |
| FAQ: Frequently asked questions | Common questions about the language and toolchain |
| Quick reference | Daily command sequences for Vary development |
| Glossary | Plain-English definitions for verification, compiler, and language jargon |
Releases |
|
| Releases | Release notes for every version |
Brand |
|
| Brand | Logo, wordmark, and visual identity guidelines |
Builtins |
|
| Templates | Pebble-based template rendering with Vary data types as context |
Libraries |
|
| AI library | Contexts, capabilities, adapters, and budgets for Vary AI workflows |
Formal verification |
|
| What formal verification is | A plain-language introduction: what a proof is and how it differs from a test |
| How vary prove works | Symbolic execution, proof obligations, result statuses, and the two modes |
| Worked examples | Bugs found by proof, and how to fix the contract or the code |
| Writing your first proofs | A step-by-step tutorial: find bugs, then prove a loop, a recursive function, a list property, and a class |
| Advanced proof techniques | Lemmas, ghost variables, changing lists in place, and what to do when a proof is stuck |
| Supported language features | Reference table of what the prover understands, by type and construct |
| Solvers | The bundled solver, Z3 and cvc5, and when to switch |
| Toolchain integration | Editor feedback, caching, CI baselines, mutation testing, and Lean export |
| Other verification tools | How vary prove relates to Dafny, SPARK, Why3 and others, and where it is weaker |