shape-runtime 0.2.0

Bytecode compiler, builtins, and runtime infrastructure for Shape
Documentation
// Core Display trait for string representation.
// Types implementing Display can be converted to human-readable strings.
// Used by print() and string interpolation to format typed values.

/// Convert a value into a human-readable string representation.
///
/// Implement `Display` for user-defined types that should participate in
/// printing, interpolation, and diagnostics.
trait Display {
    /// Render `self` as a human-readable string.
    display(): string
}

// User types implement Display via:
//   impl Display for Currency {
//       method display() -> string {
//           return 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.