Programming Language

Nocter

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

/releases/v0.52.0.md

Nocter v0.52.0 Release Notes

Nocter v0.52.0 allows explicitly capable ordinary callables to participate in compile-time evaluation. Constants and immutable statics can now call checked functions and methods without a second source interpreter or a separate compile-time language.

This release adds the const callable capability and expands compile-time values through static text, tuples, and fixed arrays. Existing runtime calls keep using the same declaration and body.

Checked Compile-Time Callables

Place const before a callable declaration to promise that its implementation belongs to the closed compile-time operation set:

const noalloc func increment(value: i32): i32 {
    return value + 1
}

const ANSWER: i32 = increment(41)

Functions, methods, construction functions, and structural callable types share the same capability. It participates in callable compatibility and interface conformance: callers may forget the promise, but a runtime-only callable cannot acquire it through adaptation.

The compiler first performs ordinary name resolution, type checking, generic specialization, operator selection, ownership checking, and dispatch selection. Compile-time execution consumes the resulting closed plan. It cannot inspect syntax, resolve another name, or select an overload.

Values and Deterministic Execution

Compile-time callables operate on scalar values, readonly static text, tuples, and fixed arrays. Their bodies may use immutable parameters and locals, primitive arithmetic and comparisons, lossless conversions, blocks, conditionals, short-circuit logic, returns, and direct calls to other compatible const callables.

Execution has deterministic semantic-operation and source-call-depth limits. Unsupported allocation, ambient state, mutable aliasing, destruction, blocking, and asynchronous operations reject the authored const promise even when no current initializer calls that body.

Recursive source call graphs are permitted when execution reaches a value within the limits. Completed closed calls are memoized inside one execution, and constant dependency cycles remain diagnosed from frozen semantic edges rather than runtime source order.

Constant and Static Initializers

Constant and immutable-static initializers now use ordinary semantic body identities. Calls from an initializer therefore use the same selected dispatch, generic arguments, parameter types, and diagnostics as runtime code.

The final checked program owns one dense value table. Early fixed-array type construction uses a separate restricted scalar table; finalization requires every early value to equal the value produced by its checked initializer. Declaration records contain metadata and initializer identity, not optional or partially completed values.

Immutable statics preserve tuple and fixed-array structure through checked execution, executable closure, machine layout, and readonly native data encoding. Constant references keep semantic identity through checking and are resolved only from the closed executable value table.

Standard Library and Tooling

Standard buffer and stream capacity policies now use real const helpers. Existing URL normalization and UTC calendar derivation also publish checked compile-time plans without maintaining compile-time-only implementations.

Formatting, diagnostics, hover, completion, and semantic tokens understand the authored const capability. Hover presents final canonical values after successful checking and uses only the available structural subset during partial declaration recovery.

Compatibility and Non-goals

Existing source without const callable modifiers remains valid. A callable that adopts const must satisfy the closed operation contract; removing the modifier returns it to ordinary runtime- only use.

This release does not add compile-time heap allocation, mutable compile-time state, procedural generation, reflection, constant generics, realtime, or another effect-list syntax.

Release Qualification

Release-content commit fdc1a9b492125bf75477378c41a56c9bb35fce08 passed the complete disposable compiler gate. Two independent optimized builds produced byte-identical archives and recursively identical installed homes. The retained archive is 9,181,215 bytes with SHA-256 ca49a2e12054829f96a07df81ad790644b4e84ee5591ccd629fe6bfe9228c01f and contains exactly 307 standard-library files. A fresh extraction passed version and installation diagnosis, locked/offline package workflows, native build and execution, every public example, the complete asynchronous file-report success and cleanup contracts, framed LSP analysis, immutability checks, and compiler and standard-library tamper rejection. The published release reused this exact retained archive without rebuilding it.