VOID Libraries

Use the library.
Build your own.

The standard library is written in VOID, and project library output can now package your own VOID code as a native static archive with stable exported C entry points.

Standard library surface

Library types expose the same ownership and runtime rules as user code.

Text, collections, IO, async primitives, and memory APIs keep their representation and lifetime boundaries explicit. Console policy lives in StandardLibrary code over reusable readers, writers, and streams; managed Memory retains a GC owner; and NativeMemory stays deliberately manual.

Built-in static APIs

Built-in APIs stay ordinary library APIs.

Type-qualified access now gives built-in and constructed-generic types the same static-member route as ordinary source types. Scalar Parse/TryParse APIs, Index.Start/End, Range.All, and EqualityComparer<T>.Default can therefore live in StandardLibrary source instead of requiring member-specific compiler lowering.

Current

List<T>

Resizable generic sequence with indexing, enumeration, managed-element tracing, and collection initializer support.

Current

Queue<T>

FIFO storage built as normal generic library code.

Current

Stack<T>

LIFO storage using the same generic/runtime model.

Current

Dictionary<TKey,TValue>

Generic hash lookup with resizing, removal, enumeration, and multi-argument collection initializer entries through Add(key, value).

Current

HashSet<T>

Generic set semantics using the dictionary-compatible hashing/equality model and collection initializer syntax.

Current

EqualityComparer<T>.Default

A generic default comparer exposed through ordinary constructed-type static member access, using the same generalized type-receiver path as other static APIs.

Current

IEnumerable<T> / IEnumerator<T>

The shared iteration contract used by collections, foreach, and compiler-generated iterator state machines.

Current

Index / Range

First-class position and slice values with from-end forms, Index.Start/End, Range.All, and reusable consumer semantics. Arrays use ranges to produce copies; Span consumers preserve view semantics.

Current

Span<T> / ReadOnlySpan<T>

Stack-only library ref structs built on VOID's safe by-reference and escape model, with slicing, normal/ref/ref-readonly enumeration, overlap-safe memory operations, and unsafe pointer+length construction for non-owning unmanaged views.

Current

Memory<T> / ReadOnlyMemory<T>

Heap-storable managed array-backed memory using array + start + length. It slices without losing its owner, bridges explicitly to Span through .Span, survives suspension and GC, and remains deliberately separate from arbitrary native-memory ownership.

Current

NativeMemory

Explicit unsafe unmanaged allocation, free, reallocation, aligned allocation, and typed allocation for where T : unmanaged. Native allocations never become GC objects, and Span views over them remain non-owning.

Current

string

One immutable GC-managed UTF-8 text type with validated scalar values, embedded NUL support, scalar-based length/index/range semantics, ordinal search/editing, and explicit ByteLength. Native string representation remains an ABI concern rather than a second VOID text type.

Current

StringBuilder

Mutable construction storage for repeated text building. It reuses VOID's allocation and UTF-8 machinery, then produces an ordinary managed string instead of becoming another text representation.

Current

Encoding.UTF8

The standard UTF-8 encoding surface shares the same validated text model used by managed strings. Byte-oriented boundaries stay explicit instead of turning normal string operations into raw UTF-8 indexing.

Current

Scalar Parse / TryParse

Appropriate built-in boolean, integral, character, floating-point, and decimal types expose source-owned parsing contracts with shared format/overflow behavior and defined floating special-value handling where applicable.

Current

Console

Standard input, output, and error support line and character input, writing, redirection, encoding, and standard-stream access through visible library policy rather than compiler-specific Console lowering.

Current

TextReader / TextWriter

Reusable text abstractions back Console.In, Out, and Error, so redirected or test-controlled text endpoints use the same public contracts as the normal console.

Current

Stream / MemoryStream

The synchronous stream foundation backs standard byte endpoints and managed-memory streams. MemoryStream supports expandable owned buffers and array-backed regions while preserving normal stream ownership, bounds, and disposal rules.

Current

Console keys & terminal control

ReadKey, key availability, Ctrl+C policy, colors, cursor state, clearing, and compatible title support expose interactive terminal behavior without turning ANSI sequences or host APIs into VOID's public abstraction.

Current

TaskAwaiter / TaskAwaiter<T>

Task.GetAwaiter() moves ordinary Task awaiting onto the same structural protocol used by custom awaitables. The awaiter can register directly with Task completion rather than manufacturing another continuation Task.

Current

YieldAwaitable

Task.Yield() returns a small value-type awaitable whose continuation queues through the existing ThreadPool. It proves generalized await can suspend without allocating a Task merely to represent the yield point.

Current

ValueTask / ValueTask<T>

True value-type awaitables with inline synchronous completion and typed-result paths, plus Task-backed asynchronous, faulted, and canceled paths. They share the generalized await mechanism without adding pooling or a separate value-task runtime.

Current

Task completion & async scheduling

CompletedTask, FromResult<T>, and faulted/canceled completion factories create already-terminal Tasks without worker work. Task-returning delegates passed to Task.Run are unwrapped through continuations so callers observe one Task rather than a nested Task or a blocked worker.

Current

Task.WhenAll / Task.WhenAny

Nonblocking Task aggregation and first-completion composition reuse the existing continuation machinery. WhenAll preserves typed result order, while WhenAny completes with the winning Task regardless of that Task's final state.

Current

Task.Delay

Finite delays use the shared monotonic timer queue rather than sleeping workers or spawning per-delay threads. Zero can complete immediately, Timeout.Infinite remains pending by time, and cancellable delays resolve timer-vs-cancel races exactly once while cleaning up registrations.

Current

CancellationTokenSource composition

Sources own and dispose their timer/external registrations deterministically. CancelAfter schedules delayed cancellation through the same timer queue, while linked sources propagate parent cancellation through ordinary registrations and unregister from every parent when disposed.

Current

Task.WaitAsync

Cancellation and timeout forms create nonblocking proxy waits over an existing Task. Antecedent completion, wait cancellation, and timeout race for one terminal result; losing registrations are cleaned up, and canceling or timing out the wait never cancels or otherwise mutates the antecedent Task.

VOID library export
public static class MathApi
{
    [Export("void_math_add")]
    public static int Add(int left, int right)
    {
        return left + right;
    }
}
VOID consumer binding
public static class MathNative
{
    [Native("void_math_add")]
    public static unsafe extern int Add(int left, int right);
}

Project libraries

VOID projects can ship as native archives.

Setting "output": "library" turns the normal build pipeline into a native static archive. [Export] gives selected public static methods stable C entry points, while initialization and managed static roots continue to use normal VOID runtime rules across repeated calls.

Collection construction

Collection expressions reuse existing collection contracts.

Contextual array initializers and target-typed collection expressions flow through the same conversion, overload, Span, and collection-construction rules used elsewhere in the language. Empty expressions, spreads, List targets, and compatible custom collections do not introduce a parallel collection type system.

Collection expressions
int[] baseValues = [1, 2, 3];
int[] combined = [0, ..baseValues, 4];

ReadOnlySpan<int> view = [10, 20, 30];
List<int> scores = [10, 20, 30];