Norm 0.7
Norm 0.7 establishes the compiler architecture for sustained evolution and delivers an incremental compilation session with an explicit lifecycle. This page defines the 0.7 implementation contract; the language specification remains authoritative for syntax and type rules.
Compilation boundaries
- Compilation results are separated into immutable
CoreArtifact, runtimeCompilationState, and theCompilationOutputcomposition boundary. - The frontend, execution API, Truffle backend, and CLI are independent Gradle modules. The execution API does not depend on a concrete backend.
NormRuntimeis the runtime composition entry point, and Truffle consumes only Core artifacts.- ArchUnit enforces dependency direction across frontend, bound, Core, and Truffle code.
Incremental compilation
CompilerSessionprovides the compile, analyze, snapshot, invalidate, and close lifecycle.- Parsed documents and compilation units use capacity-bounded LRU caches.
- Declaration analysis reuses results through semantic dependencies and invalidates them when declarations, imports, package context, or compilation scope change.
- Compilation controls provide cancellation and budgets for document count, source size, work units, and Core canonicalization search.
Core infrastructure
CoreWalkerandCoreRewriterare the single traversal and rewriting entry points for Core IR, including capture types and references.- Definition stores use one batched
putAllwrite boundary, perform capacity maintenance once per batch, and publish safely by shard. - Core canonicalization exposes search memoization, budget controls, and metrics.
- Gradle generates the build version consumed by the CLI and Truffle metadata.
Language and runtime consistency
- Identifier semantic values use NFC while tokens retain their original spelling and exact source span.
- Equality and ordering operators cannot be chained; explicit parentheses can still combine comparison results.
- Map and Set use the language's built-in equality/hash semantics, including for composite value keys and elements.
- Range and StringBuilder runtime values retain their compiled
CoreType. clampvalidates interval order and reportsINVALID_ARGUMENTthrough the sharedrequireprimitive when its contract is violated.- Parser recovery continues after missing tokens and local damage, while VS Code run tasks preserve process exit status.
Module projects
- Project configuration is a package-less
module.normbeside the application entry and returns its definition through an ordinary NormModule module()function. - The compiler and runtime execute module configuration with standard-library access and publish the result as a typed
ModuleDescriptor. - The dedicated
project-systemmodule owns project discovery, source ownership, export boundaries, dependency resolution, and module graph construction. - Compilation scopes express module identity and dependencies through
ModuleCoordinate,ModuleSourceCoordinate, andModuleGraph.
VS Code and releases
- Running the current file first saves modified Norm documents in the same workspace so project configuration and cross-file dependencies use one disk snapshot.
- Development VSIX packages support the current-source JVM server together with a staged multi-platform native CLI bundle.
- Universal release packages assemble platform CLIs from the release target manifest and verify their versions, content hashes, and VSIX layout boundaries.
Upgrade note
Java integrations should use CompilerSession to obtain CompilationOutput, pass CoreArtifact across backend boundaries, and execute programs through NormRuntime. The former Compiler, CompilationEnvironment, CoreCompilation, and ProgramRunner APIs have been removed.
See the compiler design, implementation strategy, and toolchain development standard for the complete boundaries.