Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

Strings & interpolation

UTF-8 views and explicit ownership.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Borrowed text

A normal string literal is immutable static UTF-8 data viewed as str and does not allocate. char represents a Unicode scalar, rather than a byte or a C character.

Interpolation

const Name: str = "Ada";
const Label: str = $"Player {Name}";

Interpolation uses $"...{Expression}...". When every embedded expression and selected formatter is compile-time evaluable, the result folds to static storage and has type str.

Runtime text

Runtime interpolation produces an owning String with default-allocator behavior. It can allocate. It does not have the borrowed literal's allocation-free contract.

Failure behavior

The accepted runtime interpolation design fatal-traps if building the string fails. APIs with recoverable text construction need their documented fallible paths instead.

Formatting

Embedded types must satisfy the canonical Formattable contract. The text and formatting modules document the public conversion and builder APIs.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library