Programming Language

Nocter

A self-contained systems language built around simplicity, encapsulation, and foolproof design.

/releases/v0.57.0.md

Nocter v0.57.0 Release Notes

Nocter v0.57.0 adds constant generic capacities to the language and uses them to provide practical fixed-capacity standard containers. A constant argument is evaluated once into semantic data, then keeps the same identity through type checking, specialization, layout, ABI lowering, native code, and editor presentation.

Constant Generic Capacities

Generic parameter lists may declare const N: usize, and type applications provide the matching structural constant argument in the same ordered list as ordinary type arguments:

struct Buffer<T, const N: usize> {
    values: [T; N]
}

let page: Buffer<u8, 4096>

Constant parameters may determine fixed-array lengths and may be inferred from structural callable inputs. Wrong argument domains, arity mismatches, unsupported constant types, unevaluable values, and otherwise undetermined parameters are rejected at their semantic use sites. Closed structural constant expressions are canonicalized before they participate in type identity.

Repeat Array Construction

[value; length] constructs a fixed array by evaluating value exactly once and copying it into each element. The element must therefore be copyable when length is greater than one. Context fixes the result element type and length, while a symbolic usize parameter may supply the length inside a generic declaration.

Repeat construction remains a runtime expression. Compile-time aggregate evaluation and runtime aggregate construction share normalized constant lengths without treating the expression as a source-level macro or repeatedly executing its operand.

Fixed-Capacity Standard Data

The new std/fixed module provides:

  • FixedVec<T, N>, an inline-storage sequence with bounded push, pop, indexed access, clear, and owning iteration; and
  • ByteBuffer<N>, a dense initialized byte buffer with a committed prefix and explicit spare-byte access for protocol and I/O staging.

Capacity is part of each type. Construction and bounded mutation do not allocate, full-capacity operations fail without publishing partial state, and initialized-element ownership is preserved through clearing, destruction, and iteration. Dynamically allocated Vec and byte buffers remain the appropriate choice when capacity is not known statically.

Native and Editor Integration

Specialization carries constant values into executable identity, fixed-array and nominal layout, indirect aggregate ABI decisions, MIR, and ARM64 stores. Distinct capacities remain distinct all the way to native execution; no hidden runtime generic argument or second source evaluator is introduced.

Formatting, diagnostics, hover, signature help, completion, navigation, rename, and semantic highlighting present authored constant parameters and canonical specialized values. Editor features consume the checked application rather than reconstructing constant arguments from text.

Compatibility and Non-goals

Existing type-only generic declarations and applications retain their meaning. Code may add const N: usize where storage shape or capacity must be known statically. The usize domain is the only supported constant-parameter domain in this release.

v0.57.0 does not add constant defaults, symbolic arithmetic over constant parameters, constant inequality predicates, associated constants, variadic generic packs, compile-time owned allocation, or general dependent types.

Release Qualification

Release-content commit 180bac07b66fd031eade3a1fd40fd0fcdc219245 passed the complete disposable compiler gate. Two independent optimized builds produced byte-identical archives and recursively identical installed homes. The retained archive is 9,357,170 bytes with SHA-256 18647cbddba6fd0bf32edc50506846423b22d912d9fde2ea0f730a9e74ef2f2a and contains exactly 335 standard-library files. A fresh extraction passed version and installation diagnosis, locked/offline package workflows, native build and execution, every public example, interactive LSP analysis and edit recovery, immutability checks, and compiler and standard-library tamper rejection. Publication must reuse this exact retained archive without rebuilding it.