Secure edge language for reversibility and accountability in hostile environments.
Oblíbený (Czech for "favorite" or "beloved") is a dual-form programming language that guarantees termination through Turing-incompleteness while maintaining full reversibility and complete accountability. Built for deployment in hostile environments where formal guarantees are essential.
CI-gated since 2026-06 — the language toolchain is functional: OCaml build, the 27-test conformance suite, and the Idris2 ABI proof layer (genuine total proofs since PR #51, no believe_me/postulate) are all gated in CI (PR #52). Honest open items: the Zig crypto FFI compiles (Zig 0.13, PR #56) but links only where the external liboqs library is installed; the obli-pkg signature-verify path is an explicit MVP stub (TODO(security)); see .machine_readable/6a2/STATE.a2ml for the live blocker list.
| Component | Status | Description |
|---|---|---|
Compiler & Runtime | ✅ 100% | OCaml compiler with lexer, parser, type checker, evaluator, constrained form validator |
Static Analyzer | ✅ 100% | Resource bounds tracking, reversibility checking, trace coverage analysis |
LSP Server | ✅ 100% | Language Server Protocol with diagnostics, hover, completion (789 LOC) |
Debugger | ✅ 100% | Reversible debugger with forward/backward stepping, checkpoint inspection |
Profiler | ✅ 100% | Performance profiling with resource bounds, efficiency analysis, bottleneck detection |
VSCode Extension | ✅ 100% | Syntax highlighting, reversible op highlighting, invalid keyword detection |
Echo Residue Type | ✅ 100% | First-class |
Documentation | ✅ 100% | Language specification, tutorial, security model, API reference, EXPLAINME, contractiles, echo-6a2 spec |
Crypto FFI | Post-quantum crypto (liboqs + libsodium) via Zig FFI with Idris2 ABI proofs; compiles under Zig 0.13, links only with system liboqs; obli-pkg verify path is an MVP stub (TODO(security)) | |
Deployment | ✅ 100% | Svalinn/Vordr verified container stack with formal verification |
Oblibený separates compile-time and runtime concerns:
// Factory Form (Turing-complete, compile-time)(define(generate-loop n)(emit `(for i in0..,(const n){trace("iteration", i);})))// Constrained Form (Turing-incomplete, runtime)fnmain() -> (){checkpoint("start");for i in0..10{// Static bound requiredtrace("iteration", i);}checkpoint("end");}Theorem: All valid constrained form programs terminate.
Enforcement:
- ❌ NO while or loop keywords (rejected by parser)
- ❌ NO recursive function calls (enforced by call graph checker)
- ✅ ONLY bounded iteration: for i in 0..N where N is static
- ✅ Acyclic call graph guaranteed
Every operation has a well-defined inverse:
incr(x,5);// Inverse: decr(x, 5)swap(a, b);// Self-inverse
x ^= val;// Self-inverse (XOR)Reversible debugger can step backward through execution!
Every operation produces an immutable audit trail:
checkpoint("start");trace("event", arg1, arg2);assert_invariant(condition,"message");checkpoint("end");Traces are cryptographically hashed for integrity.
The type-level dual of the reversible core. Where a computation cannot be reversed, it can still retain a structured echo of what was lost:
// Parity collapse: distinct sources (7, 9) → same visible (1)// but the witness retains the original source valuefncollapse(n:i64) -> echo[i64, i64]{returnecho(n, n % 2);}fnmain() -> (){let a:echo[i64, i64] = collapse(7);let b:echo[i64, i64] = collapse(9);// Same observation survived (both odd)assert_invariant(echo_visible(a) == echo_visible(b),"same parity");// Witnesses tell the sources apartassert_invariant(echo_witness(a) != echo_witness(b),"distinct sources");}| Form | Syntax | Meaning |
|---|---|---|
Type |
| Residue of a collapse |
Introduction |
| Form a residue |
Elimination |
| The surviving observation |
Elimination |
| The retained source constraint |
Linearity discipline: echo[A, B] is linear (consumed exactly once) if and only if A or B is non-copyable. echo[i64, i64] projects freely; echo[Cargo, i64] is consumed on first projection, and discarding it unconsumed (overwrite or drop) is a type error — an irreversible step must account for an echo of what it loses (PR #55).
This realises, in a non-dependent constrained language, the echo-types fibre
Echo f y := Σ (x : A), f x ≡ y
from hyperpolymath/echo-types (Agda).
See docs/echo-alignment.md and docs/specs/echo-6a2.adoc for the ecosystem alignment decisions.
# Fedora/RHEL
sudo dnf install opam ocaml-dune ocaml-menhir
# Build dependencies
opam install dune menhir sedlex yojson ppx_deriving ppx_deriving_yojson alcotest
# Crypto libraries (for FFI)
sudo dnf install libsodium-develgit clone https://github.com/hyperpolymath/oblibeny.git
cd oblibeny
dune build
dune installCreate hello.obl:
fnmain() -> (){checkpoint("start");trace("message","Hello, Oblíbený!");checkpoint("end");}Run:
oblibeny hello.oblfnmain() -> (){letmut a:i64 = 0;letmut b:i64 = 1;checkpoint("start_fibonacci");// Bounded iteration with static Nfor i in0..10{trace("fib", a);let tmp:i64 = a + b;
a = b;
b = tmp;}checkpoint("end_fibonacci");assert_invariant(a == 55,"10th Fibonacci should be 55");}oblibeny --analyze fibonacci.oblOutput:
=== Oblíbený Static Analysis Report === ## Constrained Form Validation ✓ VALID - Program conforms to Turing-incomplete constrained form ## Resource Bounds (Static Guarantees) Max loop iterations: 10 Max call depth: 0 Estimated memory: 24 bytes ## Reversibility Analysis ✓ All reversible operations are properly balanced ## Accountability Trace Coverage Coverage: 40.0%
oblibeny input.obl # Compile and execute
oblibeny --check input.obl # Validate constrained form only
oblibeny --analyze input.obl # Static analysis with resource bounds
oblibeny --dump-ast input.obl # Show parsed AST
oblibeny --dump-trace input.obl # Show accountability trace
oblibeny -v input.obl # Verbose outputoblibeny --debug program.oblCommands:
s, step - Step forward b, back - Step BACKWARD (reversible!) p, print - Show current state t, trace - Show accountability trace c, continue - Run to next checkpoint h, help - Show help q, quit - Exit debugger
Oblibeny integrates with:
Idris2: ABI proofs for FFI safety (
src/abi/*.idr) — genuine total proofs, machine-checked in CI with an escape-hatch guard (nobelieve_me/postulate; PRs #51/#52)Zig: Memory-safe FFI implementation (
ffi/zig/)Vörðr: Runtime verification with formal proofs
Verified properties: - ✓ Termination guaranteed - ✓ Resource bounds computable statically - ✓ Call graph is acyclic - ✓ No unbounded loops - ✓ Reversible operations correct
# Build with formal verification
svalinn-compose build
# Deploy LSP server (2 replicas)
svalinn-compose up
# Scale analyzer/debugger on-demand
svalinn-compose up --scale analyzer=1See svalinn-compose.yaml for full configuration.
EXPLAINME - What Oblíbený is, why it exists, and why it matters (start here)
Language Specification - Complete grammar and semantics
Tutorial - Step-by-step guide with examples
Examples - 10+ example programs
Core Specification - Formal specification in Scheme
Contractiles - Formal behavioral contracts and invariants
Echo Interface Spec §6.a.2 - Echo-types external interface contract
Echo Alignment - Decisions ledger for echo-types ecosystem alignment
┌─────────────────────────────────────────────────────────┐
│ Oblíbený Architecture │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Factory Form │────────▶│ Constrained │ │
│ │ (Turing- │ emits │ Form │ │
│ │ complete) │ │ (Turing- │ │
│ │ │ │ incomplete) │ │
│ └──────────────┘ └──────┬───────┘ │
│ Compile-time │ Runtime │
│ Metaprogramming │ Execution │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Accountability │ │
│ │ Trace │ │
│ │ (Immutable) │ │
│ └─────────────────┘ │
│ │
├─────────────────────────────────────────────────────────┤
│ Tooling Layer │
├─────────────────────────────────────────────────────────┤
│ Compiler │ Static Analyzer │ Debugger │ Profiler │
│ LSP │ VSCode Ext │ CLI │ Crypto FFI │
└─────────────────────────────────────────────────────────┘Oblibeny’s constrained form is intentionally Turing-incomplete:
Syntactic restrictions prevent unbounded computation
Call graph analysis ensures acyclicity
Static bounds checking verifies all loops terminate
Formal verification proves termination mathematically
This makes Oblibeny ideal for: - Hardware Security Modules (HSMs) - Secure enclaves (SGX, TrustZone) - Smart cards - Critical embedded systems - High-assurance cryptographic code
| Metric | Value |
|---|---|
Lines of Code | ~5,900 (OCaml 4,304 + Zig 1,047 + Idris2 554; measured 2026-06-12) |
Files | 170 tracked |
Languages | OCaml (20 files), Zig (5 files), Idris2 (3 files) |
Status | Active development (see .machine_readable/6a2/STATE.a2ml) |
Test Coverage | 27-test conformance suite, CI-gated (PR #52) |
Documentation | Complete (spec + tutorial + examples) |
Container Size | ~50MB (minimal runtime) |
See CONTRIBUTING.adoc for development guidelines.
Code of Conduct: CODE_OF_CONDUCT.md
SPDX-License-Identifier: CC-BY-SA-4.0
Oblíbený is free software under the Palimpsest License (MPL-2.0).
See LICENSE for full terms.
Svalinn - Edge gateway for verified containers
Vörðr - Formally verified container runtime
Selur - Zero-copy WASM bridge
Verified Container Spec - Formal specification
NextGen Languages - Language portfolio
Discussions: https://github.com/hyperpolymath/oblibeny/discussions
Author: Jonathan D.A. Jewell <jonathan.jewell@open.ac.uk>
Guardian of correctness. Keeper of accountability. Beloved for its guarantees. 🔐✨