Programming Language

Nocter

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

/development/reviews/v0.35.0-phase-1.md

v0.35.0 Phase 1 Immutable-static Implementation Review

Result: complete with no open Phase 1 finding (2026-09-04). The compiler now carries one immutable-static identity and one evaluated frozen value from declaration construction through native readonly data and semantic tooling. Unicode data generation remains Phase 2 work.

Closed Product

static remains a contextual declaration word, so ordinary declarations may still use static as a name. Contract joining treats const and static as two kinds of the same root-contract pattern without conflating their value semantics. The shared compile-time evaluator owns scalar expression typing once and adds recursive fixed arrays only for frozen static values. Declaration validation checks the resulting typed value without rereading initializer syntax.

Checked bodies expose a static reference as a readonly borrowed place with static provenance. Invocation ownership state contains no static move path: copy reads, indexing, and readonly borrows are legal, while move, mutation, read-write borrow, and cleanup are rejected before MIR. Executable closure construction retains only statics referenced by reached bodies and assigns dense executable identities. MIR transports those identities and frozen values without choosing a layout.

Machine layout alone converts each reachable frozen value to aligned bytes and explicit relocation records. Equal string payloads may share data, but every static declaration retains a distinct addressable object even when its bytes are equal. ARM64 resolves section-local targets and exposes absolute data-pointer fields to Mach-O. Mach-O emits a __DATA_CONST segment plus dyld rebase metadata, allowing ASLR to slide embedded string-view pointers before the segment becomes readonly.

Review Findings Closed During Implementation

  • Ownership initially tried to require invocation initialization state for static roots. The move path contract now explicitly returns no flow-tracked path for immutable program storage.
  • Native scalar-array access succeeded while dereferencing a static string view crashed under ASLR. The cause was an absolute preferred address without loader rebase metadata. The image writer now owns a classic dyld rebase stream rather than weakening position independence.
  • Machine data initially deduplicated equal static representations. Static semantic identity is now part of the data key, while literal text retains intentional content sharing.
  • Contextual keyword tooling initially handled new declaration words case by case. Top-level contextual declaration completion now derives candidates through one syntax-owned path, and highlighting obtains the exact parser-owned introducer token.

Evidence

  • declaration tests cover contract/implementation joining, unsupported types and initializer shapes, and compile-time evaluation;
  • checking tests cover read, borrow, indexing, move, mutation, read-write borrow, and cleanup boundaries;
  • executable tests prove unreachable-static elimination;
  • machine and ARM64 tests cover typed layout, distinct static identity, relocations, bounds, and overlap rejection;
  • native execution reads numeric arrays and relocated string-view arrays from immutable static storage;
  • semantic tooling tests cover hover, completion, definition, references, rename, readonly highlighting, and the contextual static introducer;
  • the complete workspace test, warnings-denied Clippy, formatter, documentation, and diff checks pass at the reviewed commit.

Boundary Result

No backend crate can access initializer syntax or declaration namespaces. Constant evaluation does not know machine layout. Machine does not infer relocation targets from bytes. Mach-O does not know semantic static identities. Editor features consume source-index identities and declaration products, never encoded data. No Unicode-specific compiler role or table has been introduced.