Skip to content

Norm 0.2 ​

Norm 0.2 is the generic multi-file basic-computation release. This page is the 0.2 delivery contract. The language specification defines final semantics; 0.2 delivers only the listed strict subset and does not introduce temporary alternative semantics.

Language ​

  • generic user classes and top-level functions;
  • parameterized fields, parameters, results, locals, and nested type arguments;
  • no raw types and invariant generic types;
  • exact call-site inference from arguments and an optional expected type, plus explicit type arguments;
  • runtime type descriptions retaining declaration identity and ordered type arguments;
  • Java-style package, explicit single-name import, aliases, public, file-private top-level declarations, and private class members;
  • signature collection across a source root before body analysis, enabling cross-file calls and recursion.

0.2 excludes bounds, use-site variance, nullable types, interfaces, inheritance, generic data enums, switch, exceptions, reflection, and ref<T>.

Projects and tooling ​

norm run <entry.norm> selects main() from the entry file. The application entry and module.norm share the module root-package directory. Files in that package join the project automatically; sources in other packages must be exported by the module configuration. An entry without module configuration remains a single-file script.

The CLI and LSP share one project semantic model. Diagnostics, type-aware completion, signature help, automatic imports, hover, definition, references, and rename support generic type parameters and symbols across files in the current source root while enforcing module exports, file-private top-level declarations, and private class members. module.norm returns the descriptor from a zero-argument Module module() factory. For module std, export math.integer identifies std/math/integer.norm. See the module system for the complete rules.

Each project analysis produces an immutable semantic snapshot shared by diagnostics and language features for that revision. CLI and Polyglot execution share one Bound IR backend entry point. Runtime failures expose stable error codes, source locations, and guest stacks.

Core library ​

  • generic Array, List, Map, Set, Stack, Queue, Deque, and Pair;
  • Range and StringBuilder;
  • std.math implements abs, min, max, clamp, and sign in Norm and requires explicit single-name imports;
  • std.testing provides the equal, notEqual, isTrue, and isFalse predicates used by 0.2 library and acceptance tests;
  • std.collections provides listContains, listCount, reversed, and toList;
  • std.text provides repeat and join;
  • collection and finite-sequence cardinality uses size() exclusively;
  • String distinguishes byteSize(), codePointSize(), and graphemeSize();
  • map[key] requires an existing key. Safe Option<V> lookup waits for generic data enums; there is no dynamic get or null sentinel.

Executable specification ​

The 0.1 single-file acceptance programs migrate to parameterized collections and size(). The 0.2 suite also covers generic declarations and inference, raw-type rejection, generic invariance, cross-file calls and recursion, package/import visibility, cross-file LSP features, runtime parameterized type descriptions, and importing and executing packaged standard-library sources.

Norm 0.25