v0.22.0—Bounded nullability checks and practical .NET migration guidance.See what's new

Calor logo

Calor

A language for coding agents, compiled to C# and .NET.

Inspect explicit contracts, declared effects, and stable IDs.

From Calor to a .NET program

Program.calr — Calor

§M{m001:HelloApp}
  §F{f001:Main:pub} () -> void
    §E{cw}
    §P "Hello from Calor!"

Run with the .NET 10 SDK and Calor installed

calor run Program.calr

Program output:

Hello from Calor!

Calor emits C# and uses the .NET SDK to build and run it. Follow the complete setup and first-run steps. No AI subscription required.

Compare runtime contracts

Both examples reject negative inputs and check a nonnegative result. These are function fragments with no caller, not complete runnable programs. Exception types and diagnostic details differ.

program.calr — fragment
§M{m001:Math}
  §F{f001:Square:pub} (i32:x) -> i32
    §E{}
    §Q (>= x 0)
    §S (>= result 0)
    §R (* x x)

What the code declares or checks

  • §Q and §S declare the input and normal-return obligations.
  • The optional f001 ID gives editing tools a named target when preserved across edits.
  • §E{} declares no effects; enforcement depends on resolved calls and documented coverage.

Runtime checks depend on contract mode and supported body shapes. Optional --verify asks Z3 to prove supported obligations and can remove eligible postcondition guards; --keep-proven-guards prevents that removal. These checks do not establish whole-program correctness. Read the verification guarantees and limits.

Find an undeclared network effect

Illustrative fragment: assume SaveOrder declares database access and NotifyCustomer declares network access. Their definitions, the Order type, and a caller are omitted. This is not a runnable example.

order-service.calr — fragment
§F{f001:ProcessOrder:pub} (Order:order) -> void
  §E{db:rw}
  §C{SaveOrder} §A order §/C
  §C{NotifyCustomer} §A order §/C
Illustrative diagnostic (abridged, not captured output)
Calor0410: ProcessOrder uses a network effect
that its declaration does not permit.

Review the call and either remove the effect
or declare it if the operation is intended.

Effect checking follows resolved calls across the supplied Calor inputs. Unknown external calls and raw C# need separate diagnostics, manifests, or review. A missing declaration is not permission to broaden an interface automatically. See the effect reference.

Type and effect checks are on by default. Static bug-pattern analysis requires --analyze; contract verification requires --verify. Supported checks, runtime modes and opt-outs are documented in compile options. None guarantees that every defect is found.

Evidence and its limits

The historical static snapshot covers 217 source pairs and 8 deterministic calculators. Source revision c2a8816d declares compiler v0.21.0; the executed binary was not independently recorded.

The pairs are not all behaviorally equivalent. Repeating deterministic scores does not establish sampling uncertainty, and these scores do not measure agent productivity, safety, or a language advantage. Separate agent studies have their own dates, instruments, and limitations.

Snapshot: . Corpus: tests/TestData/Benchmarks.

Use an existing .NET project

Requires the .NET 10 SDK. Run these commands in a directory containing your .csproj and Calor source files; keep your existing entry point. Starting from scratch? Run the complete Hello World example without an AI subscription.

calor-terminal
Install Calor
$ dotnet tool install -g calor

One command. Works on Windows, Mac, and Linux. Requires .NET 10+.

Enable Calor in your project
$ calor init

Adds MSBuild integration. Connecting an AI agent is optional.

Build and check
$ dotnet build

Compiles the Calor sources in this project to C# and builds the application.

Reference and help