# HoldFast Playground

HoldFast is a systems programming language with ownership, borrowing, and
mathematical proofs. Its function signatures specify how arguments transfer
ownership or lend access. Contracts state what a function requires and what
it guarantees. In the Playground, edit a module and evaluate expressions
against it. The available source and proof checks depend on the mode.

## Run a HoldFast example

Open [Functions & values](./?example=squares#playground). The default
example includes this `Square` function, shown here as a complete small module.

```hf
module Playground;

/// Squares a natural number in a static evaluation or an ordinary call.
public const Nat Square(Nat value) => value * value;
```

In **Console**, enter `Square(7)`, choose **Result type** `Nat`, and select
**Run**. The result is `49`. Select **Compile** to see the Gallina translation
of the current module.

<a id="what-each-mode-checks"></a>

## Checking source and replaying proofs

- **Browser** translates the pure `Nat` and `bool` subset to Gallina. For
  broader examples, **Run** evaluates a sample expression and **Compile**
  shows a preview. Open **Problems** to see which proof obligations are unchecked.
- **Local compiler** checks one module and emits Gallina for supported loans,
  natural usage grades, contracts and dependent types. [Local Playground setup](tooling/playground/#scope-and-launch)
- **Rocq replay** checks the emitted proof terms. The repository qualification
  command also audits the assumptions of its examples. [Replay a Playground proof](formal-verification/#kernel-replay)

## Learn the language

- [Effect system](effect-system/) covers read, write, and call bounds.
- [Borrow checking](borrow-checking/) covers ownership transfers, loan
  modes, and lifetimes.
- [Graded types](graded-types/) covers exact, bounded, and type-only use.
- [Dependent types](dependent-types/) covers length-indexed vectors and
  checked lookup.
- [Formal verification](formal-verification/) covers contracts, proof
  obligations, and Rocq replay.
- [Language reference](language/reference/) specifies syntax and semantics.
- [Documentation index](documentation/) lists language, tooling, and assurance documents.
