DEVELOPMENT EDITION · 769442725406
Programmer Guide
On this page

Prepare the environment and run a project

This page gets a finished program running and explains what each command tells you. The beta quick start installs Verada from its disk image; Building and installing Verada builds it from source, with its dependencies.

Check your tools

The compiler is veradic. Run:

veradic --version

It prints the compiler version, its LLVM code generator and the solvers it found. Proof needs Z3 (the other solvers are optional); native executables need a C compiler to link. In a Verada source checkout you can write stack exec veradic -- wherever this guide writes veradic.

check needs neither a solver nor a C compiler, so it works even when those are missing. The command index shows which commands use which tools.

Run your first project

The examples live in the Verada source tree under docs/manuals/examples. From the root of that tree, for Vada:

veradic check --project docs/manuals/examples/first-proof/vada/after/verada.toml
veradic prove --project docs/manuals/examples/first-proof/vada/after/verada.toml
veradic run --project docs/manuals/examples/first-proof/vada/after/verada.toml

For Varc or Vibe, replace vada with varc or vibe. check prints nothing when the program is correct. prove prints a summary such as:

proved 6 of 6 checks in 2 subprograms (2 statically, 4 by the solver)

and run prints the program's output:

answer: 42

The project file tells Verada where the source files are. These projects use their own directory:

[project]
source-dirs = ["."]

To work on a copy, copy the whole directory and run the commands inside it with --project verada.toml (or no --project at all: verada.toml in the current directory is used when present). Keep a package's files together; a body without its specification, or a module without the module it imports, is not a complete program.

Start a project of your own

veradic new writes a new project: verada.toml, a src/ directory with a small package whose subprogram has a contract and a main program that uses it, and a .gitignore. Choose the syntax with --syntax vada, varc or vibe (Vada is the default):

veradic new tally --syntax varc
cd tally
veradic prove
veradic run

The new project checks, proves and runs as written; edit it from there. veradic new refuses a directory that already exists. In Visual Studio Code, Verada: New Project… does the same and opens the result (editors).

To create a starter and open it directly in the browser IDE, use:

veradic ide new ~/Projects/tally --syntax varc

Open the private URL printed in the terminal, then use Project → Prove and Run. The IDE also opens existing directories with veradic ide DIR; its guide explains project creation, editing and the integrated tools.

What each command tells you

These commands answer much more than a Python or Ada parser would. A Vibe file can be valid Python and still be rejected, for example because a value can exceed a finite integer range.

Use an editor or the REPL

veradic ide opens the current directory in the local browser IDE. Keep its terminal process running while using the editor, Project, Problems, REPL and Guide panes. Project execution and the IDE REPL initially use Full proof; this differs from the command-line defaults described here. See the browser IDE.

For a worked example with the optional Assistant, follow Pythagorean triples: review a proposed Vibe program, apply and save it, then run it yourself and examine its verification evidence.

veradic lsp is a language server. Editors show its diagnostics as you type, and it proves the open file in the background: a second after a change that checks cleanly, and again on save. It also offers hover with contracts, go to definition, rename, completion, signature help, quick fixes and formatting. Editors and the language server sets up VS Code and Zed.

veradic repl evaluates declarations, statements and expressions as you type them: Vada by default, Varc with --syntax varc, Vibe with --syntax vibe. It proves each input in advisory mode: an unproved check is a warning and stays in as a run-time check. A failed input does not undo output it already printed; see the REPL.

If the first run fails