Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Snapshot · Oct 24, 2026 · Frozen documentation

Arrays & slices

Contiguous storage and borrowed views.

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

Fixed arrays

T[N] is inline contiguous storage for exactly N live elements. N is a compile-time usize. An array does not itself allocate on the heap.

Slices

T[] and readonly T[] provide read-only non-owning views. mut T[] grants writable element access. Slices carry data and length; they neither own the elements nor retain their backing owner.

Projections

Arrays and slices expose .Length and .Data. Obtaining the raw data pointer does not make its dereference safe or extend any lifetime.

Indexing

Base[Index] checks that the index is below the length in every profile and fatal-traps on failure. The index has the expected type usize. Writable access yields a writable element place; read-only access does not.

Invalidation

Returning a slice backed by a local array is invalid. Container growth, moves, or destruction may invalidate a view. The owner and operation contracts determine when a borrowed view remains usable.

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