Skip to content
Capsize-GamesPublic

About

Verification-first programming language — Z3-checked contracts, fuel-bounded VM, freestanding C codegen. No proof, no run.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

684 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Curlee

CI license: Apache-2.0 Discord last commit release

Curlee is a C++23 implementation of a verification-first programming language. It checks contracts with Z3 before run or build proceeds. No proof, no run.

Curlee limits what it accepts on purpose. The verifier must prove every contract before run or build proceeds, and proof is only possible inside a bounded fragment — so instead of silently compiling what it cannot prove, Curlee rejects it with a diagnostic that names the exact limitation. What this buys you: every program that compiles has had its stated properties proven; array and arithmetic failures become explicit errors (proven bounds or runtime guards), never undefined behavior; and the boundary never moves silently — the table below is the contract. The v1.12.0 production-readiness sweep closed the exit-alpha gate; the measured results are in the exit-alpha record.

Language surface

Construct Notes
✅ Functions, assignment, conditionals, loops VM and freestanding C
✅ Imports, aliases, shared declarations one merged program; duplicates and cycles rejected
✅ Contracts: requires/ensures, refinements, bounded forall, frame clauses, loop invariants/variants, fuel bounds checked by Z3 before anything runs
✅ Integer and Boolean arithmetic, bitwise ops, comparisons includes strict_overflow checking
✅ Fixed-size integer arrays reads/writes proven in bounds or runtime-guarded
✅ Single-owner Box<[T]> bounded 1 MiB / 64-slot arena descriptors
✅ Slices &[T] / &mut [T], len() borrowed views of fixed arrays only
✅ Scalar constants, array list literals compile-time constants
✅ F32 / F64 scalars x86-64 emission; fixed-size float arrays in x86-64 C
✅ Result<T> / Option<T> / ?, string-keyed Map<V>, general Vec<T> VM-only; capacity-bounded, runtime-checked
✅ Typestates, @linear parameters exactly-once consumption, checked at signatures
✅ Physical memory, port I/O, extern functions freestanding trust boundaries; need capabilities and unsafe
✅ Hosted I/O and standard-library wrappers VM; stdlib/v1/std/
✅ Build-time int64 .npy ingestion loads into fixed-size module arrays
✅ curlee fmt, full LSP server, installer, benchmarks v1 tooling
❌ Dynamically sized or unbounded arrays use capacity-bounded Vec<T> instead
❌ General pointer arithmetic
❌ Heap and temporal (use-after-free) proofs slices never confer ownership
❌ Stored or nested Box, stored slices, slicing expressions
❌ Unrestricted quantification bounded forall only
❌ Arbitrary nonlinear arithmetic
❌ i386 float emission and linked float kernels
❌ Windows or macOS hosts Linux-only
❌ Hosted-only features in freestanding C Vec/Map/Option runtime, hosted I/O
❌ General generics explicit kind-suffixed builtins instead; see Structured data

The table is the boundary. Full rules, evidence links and target restrictions live in the supported fragment and verification scope.

Provenance

The Curlee syntax was designed by a human. The implementation was written by automated AI coding agents working under the maintainer's direction, except for contributions attributed to the community.

Who it is for

  • Developers of small freestanding kernel and driver functions whose contracts are checked before code runs or is emitted as C.
  • Language and verification researchers who want a bounded, fail-closed fragment instead of unrestricted quantification and general heap reasoning.
  • Integrators evaluating Curlee on a named, reproducible workload — first documented case is the JOE OS kernel/driver port (adoption roadmap).

If the table above covers what you need, the Getting Started guide gets you running in minutes.

5-minute quickstart

The supported host is Linux; Windows and macOS are unsupported. On Ubuntu/Debian, install the build dependencies exactly as in Getting Started:

sudo apt-get update
sudo apt-get install -y cmake ninja-build g++ libz3-dev pkg-config

Configure and build:

cmake --preset linux-debug
CMAKE_BUILD_PARALLEL_LEVEL=1 cmake --build --preset linux-debug

Check and run a verified example. check verifies a source file; run verifies first, then executes the supported VM subset:

./build/linux-debug/curlee check examples/mvp_run_int.curlee
./build/linux-debug/curlee run examples/mvp_run_int.curlee

See Getting Started, Running Programs, and platform support for details and limits. If libz3-dev is not installed, CMake can build its pinned Z3 dependency instead; see Getting Started.

Examples

These files exist under examples/ today:

Example What it shows
examples/mvp_run_int.curlee Smallest verified program: an ensures result == 1 + 2 contract on main, used in the quickstart above
examples/mvp_run_control_flow.curlee Verified control flow across a helper call, if/else, and a loop return
examples/enum_variant_ops.curlee Enum variant check and unwrap on a Maybe value
examples/pilot_budget_gate.curlee A requires-guarded budget projection with named constants
examples/linear_capability.curlee Linear capability flow sketch; its own header comment marks it not executable yet
examples/linear_ownership.curlee Ownership-transfer sketch; not presented as a runnable VM example

Sketches marked non-executable are design notes, not runnable examples; the support boundary is the table above.

Supported workflows

  • Check function contracts, refinements, array bounds and declared loop/fuel obligations within the verification scope.
  • Run supported programs on the fuel-bounded VM.
  • Emit freestanding C and link x86-64 or i386 kernel images, subject to the target restrictions.
  • Manage local packages with pinned dependencies (curlee deps lock / curlee deps verify); see Packages.

The compiler resolves imports, checks types and sends proof obligations to Z3 before VM bytecode or C generation. CONTRIBUTING.md contains the full build and test commands.

Project status

The current workflows and known limits are described in the supported fragment. Verification covers only the implemented model; hardware, external function bodies, the host, and toolchain remain outside a Curlee proof. The verification roadmap records a concrete use case and rules for deciding scope, and the adoption roadmap records how the fragment, external validation, and downstream integration are intended to grow.

The Production support matrix and Exit-alpha criteria in the release checklist define the policy targets; exit-alpha was measured for v1.12.0 in the exit-alpha record. Current work is tracked in the JOE OS Driver-Port Language Support milestone and Performance milestone.

Documentation and contributing

Maintained documentation is in docs/README.md. It includes the syntax, verification, execution, bundle, and platform references. The GitHub Wiki has been migrated; its page-level provenance is in docs/wiki-migration-history.md.

See CONTRIBUTING.md for contribution guidance (including the bounded-task process), CODE_OF_CONDUCT.md for community standards, and SECURITY.md for vulnerability reporting — do not open a public issue for a security vulnerability.

License

Curlee is licensed under the Apache License 2.0; see LICENSE. Compiler output is not encumbered by that license: programs you write in Curlee, and the code, bytecode, bundles, and freestanding images the compiler emits from them, are yours and are not subject to Apache-2.0 as a result of being produced by Curlee. Runtime files you redistribute as part of Curlee itself remain under Apache-2.0.

Versions previously published under the prior MIT license retain those terms; the prior notice is preserved in licenses/MIT-legacy.txt, and those earlier MIT grants are not withdrawn. Contributions are accepted under the Developer Certificate of Origin (sign off with git commit -s); inbound contributions are licensed outbound under Apache-2.0, with no separate contributor license agreement.

About

Verification-first programming language — Z3-checked contracts, fuel-bounded VM, freestanding C codegen. No proof, no run.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages