shape-runtime 0.3.2

Bytecode compiler, builtins, and runtime infrastructure for Shape
Documentation
// Core Display trait for user-facing rendering.
// Types implementing Display produce structured `content` values that the
// renderer projects per output adapter (terminal → ANSI, HTML → spans, etc.).
// Used by print() and content dispatch to format typed values.
//
// W18.6 (R8 W3 2026-05-24 — supervisor D3+D4): the trait return type is
// `content` (NOT `string`) — single trait, single method, single mental
// model. Existing impls migrate via a one-line `Content.text(...)` wrap.
// No parallel Render trait; no dual-trait surface. The Content type is a
// user-facing exposure of the runtime ContentNode carrier — constructors
// live under the `Content` namespace (`Content.text`, `Content.code`,
// `Content.fragment`, ...) and route through the same renderer dispatch
// as c-strings and the per-adapter content_dispatch path.

/// Convert a value into a renderable `content` value.
///
/// Implement `Display` for user-defined types that should participate in
/// printing, interpolation, and diagnostics. The returned `content` is
/// projected per output adapter — terminal renderers produce ANSI,
/// HTML renderers produce `<span>` markup, etc.
trait Display {
    /// Render `self` as renderable content.
    method display() -> content;
}

// User types implement Display via:
//   impl Display for Currency {
//       method display() -> content {
//           return Content.text(self.symbol + self.amount.toFixed(self.decimals))
//       }
//   }
//
// Comptime fields on the type (e.g. symbol, decimals) are resolved
// at compile time with zero runtime cost.