DEVELOPMENT EDITION · 769442725406
Vibe syntax
On this page

Vibe syntax reference

Vibe writes Verada programs in typed Python. A .vb file is compiled by veradic; it does not run through a Python interpreter when you build or run it with Verada. Types, resource ownership, contracts and the proof policy are Verada's, and Vibe's library is Verada's: familiar Python spellings do not bring the Python standard library with them.

Embedded APL (apl("...")) has its own chapter, and so do proof enclaves.

Find a rule

Topic Contents
Source and tokens Indentation, identifiers, comments, literals, strings, f-strings, keywords
Grammar Complete parser production groups, semantic restrictions, operator precedence
Names and modules Files, entry points, imports, visibility, scope, initialization
Types and annotations Scalars, aliases, constraints, arrays, collection types, inference
Expressions Arithmetic, comparisons, calls, indexing, conversions, text and printing
Functions and methods Typed profiles, inferred mutation, results, defaults, generics, imported procedures
Statements Assignment, control flow, matching, loops, local declarations
Classes and generics Dataclasses, inheritance, abstract methods, Protocol, unions, PEP 695
Collections Lists, dictionaries, sets, tuples, methods and underlying libraries
Sharing and ownership Local/element views, copying, moves, allocation, deallocation, lifetime
Contracts and exceptions Preconditions, postconditions, loop annotations, user exceptions and handlers
Concurrency Protected objects, entries, tasks, delays and shutdown
Proof enclaves enclave(), Ref[T], models, footprints, invariants, ghost functions
Iteration, pipelines and matrices range, zip, enumerate, takewhile, reductions, shape and rank
Python compatibility Recognized helpers, the Python features Vibe excludes, numeric differences

The chapters explain rules directly in Vibe. Shared types, subprograms, contracts, ownership, and concurrency give the corresponding language-wide semantics. You do not need to read another syntax reference first.

A complete program and project

Put this in main.vb:

def main() -> None:
    print("Hello, Vibe")

Beside it, put verada.toml:

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

From that directory, use veradic check, veradic prove, veradic run, or veradic build -o hello. check checks legality and flow without solving proof obligations; prove and build prove first. See module structure for the entry point.

The bounded increment lesson supplies complete projects and a failure-and-repair sequence. The larger syntax-reference project exercises constraints, dataclasses, generics, protocols, a union, views, collections, tuple assignment, and text. From the repository root:

veradic prove --no-cache --project docs/manuals/examples/syntax-reference/vibe/core/verada.toml
veradic run --no-cache --project docs/manuals/examples/syntax-reference/vibe/core/verada.toml

It prints its expected output. Beside it, smaller projects each show one rule, and the rejections show the diagnostics for the Python features Vibe excludes. Other examples in this reference are fragments: each needs its stated imports and the surrounding module or function.

What acceptance means

There are three separate questions: whether a source form parses, whether it is legal Verada, and whether its proof obligations prove. A typed addition can check and still fail its overflow proof; contracts and the verification manual explain the repair. A Python form that Vibe does not take is rejected with a diagnostic, and compatibility lists the features Vibe excludes with the Vibe way to write each. The REPL reads Vibe input (veradic repl).