About Reussir
Reussir is a general-purpose functional programming platform built for rapid prototyping and high-performance native programs. Its managed-memory, Rust-like surface keeps ownership bookkeeping out of ordinary code, while its compiler turns functional construction and update patterns into in-place work whenever it can prove that doing so is safe. Reussir combines a language, compiler, REPL, package manager, runtime, and MLIR dialect in one toolchain.
MLIR is more than a stop on the way to machine code. Reussir preserves structured control flow and explicit memory behavior in its intermediate representation, where they can participate in MLIR analyses and transformations before lowering to LLVM. This makes Reussir both a standalone functional language and a functional frontend for the wider MLIR ecosystem.
Persistent functional programs often replace a value by constructing a new one. A conventional implementation allocates fresh storage even when the old value is no longer observable. Reussir instead makes that storage explicit in the IR. When a reference-count decrement releases the last reference to an object, it can produce a one-use reuse token describing the available allocation. A later constructor can consume the token and rebuild its result in the same memory.
This model generalizes the memory-reuse analyses used by Koka and Lean. Rather than encoding reuse only in a language-specific control-flow analysis, Reussir carries tokens as SSA values through MLIR branches, regions, and loops. Reuse therefore becomes an ordinary data-flow problem: the compiler can see where storage originates, which paths can carry it, and where it is consumed or released.
Token reuse is the beginning of the optimization pipeline, not its endpoint. Reussir combines reference-count cancellation, allocation sinking and fusion, closure optimization, and recursion transforms with MLIR and LLVM analyses. Several passes preserve facts that would otherwise disappear during lowering:
- Invariant-group analysis proves when projected loads remain immutable, so LLVM can retain and reuse their values.
- Whole-program devirtualization describes closure dispatch precisely enough to replace indirect calls with guarded direct calls while retaining a safe fallback.
- Uniqueness-carrying recursion follows fresh or unshared values through recursive calls and specializes paths on which uniqueness is preserved. For array aggregates, this can turn a sequence of functional updates into a loop over one unique buffer that LLVM can vectorize.
Keeping these facts explicit lets high-level functional code benefit from low-level optimization without exposing the machinery in the source program.
Reference counting is the default, but not every data structure is easiest to construct as an immutable acyclic value. Reussir provides language-level memory modalities for local mutation. A regional scope acts as an arena in which flexible objects can be updated and connected into cycles. When a value escapes the region, it is frozen into an immutable, reference-counted object; unreachable regional allocations are reclaimed when the scope ends.
This separation keeps mutation local and explicit. Cyclic graphs can be built directly during construction, then shared through the same managed functional interface as other values.
Reussir’s polymorphic FFI extends monomorphization across the Rust boundary. For each concrete foreign instance, the compiler generates and compiles a matching Rust wrapper to LLVM bitcode, then links it into the program. Calls can use concrete native representations instead of passing every value through a uniform boxed ABI, and LLVM can optimize across the resulting boundary.
This makes copy-on-write wrappers around imperative Rust data structures practical building blocks for functional APIs. Operations consume and return managed values; unique storage can be updated in place, while shared storage is cloned only when required. The same model provides direct access to Rust implementations without giving up Reussir’s ownership discipline or its functional style.