Skip to content

Norm 0.13 ​

Norm 0.13 integrates annotations into the unified object model and adds definition-side function, parameter, and field lifecycles.

Language ​

  • An annotation is an identity aggregate with fields, explicit constructors, ordinary methods, and direct construction.
  • Annotations declare their policies through Target and Retention interfaces from std.annotation.
  • FunctionTarget provides before, around, and after lifecycle methods for functions and concrete methods.
  • ParameterTarget<T> provides a strongly typed, value-replacing before and completion-only after for function, method, and constructor parameters.
  • FieldTarget<T> provides strongly typed before and completion-only after hooks for field initialization, assignment, and indirect writes through ref<T>.
  • Interceptors nest in source order, while dynamic dispatch and function references preserve definition-side behavior.
  • Each application constructs one annotation instance per execution and shares it with runtime reflection.
  • std.validation provides strongly typed built-in constraints and structured ConstraintViolation exceptions over the parameter and field lifecycles.

Migration ​

Replace 0.12 targets(...) retention(...) declarations with std.annotation policy interfaces:

norm
import std.annotation.RuntimeRetention
import std.annotation.TypeTarget

annotation Label implements TypeTarget, RuntimeRetention {
  String text
}

Annotations now follow class construction rules. Declare an explicit constructor for custom initialization; application argument names come from that constructor.

Toolchain ​

  • Syntax, Semantic, Bound, Core, and Truffle share the aggregate definition path.
  • Core callable parameters and aggregate fields carry names, types, and ordered interceptors; the identity boundary advances to Schema V9 and Language Semantics V9.
  • The formatter, Language Server, VS Code grammar, and cross-package execution support the new declaration model.

See the annotation specification, annotation grammar, validation API, and annotation tour for the complete rules.

Norm 0.25