Skip to content
@swift-primitives

Swift Primitives

The organization for primitive Swift packages

swift-primitives

Atomic building blocks for the Swift Institute ecosystem — Layer 1.

What this is

swift-primitives is the foundation layer of the Swift Institute five-layer architecture. It hosts 60+ small, composable packages that model a single domain each: buffer, geometry, algebra, memory, kernel, time, input, index, ordinal, cardinal, and many more. Every package is Foundation-free, strictly memory-safe, ~Copyable-aware, and uses typed throws.

Higher layers depend downward-only: L2 (standards) depends on L1, L3 (foundations) depends on L1 and L2. L1 depends on nothing outside itself and the Swift standard library.

Layer position

Layer Organization Role
1 swift-primitives (this org) Atomic building blocks
2 swift-standards + per-authority orgs Specification implementations (RFC, ISO, W3C, …)
3 swift-foundations Composed building blocks — IO, HTML, CSS, SVG, PDF, networking
4 Components Opinionated assemblies — planned
5 Applications End-user systems — planned

Conventions

Every package in this organization adheres to a shared set of conventions, applied at code review time:

  • Nest.Name naming — no compound type names; nested accessors over compound methods. File.Directory.Walk, never FileDirectoryWalk.
  • Typed throws end-to-endthrows(Domain.Error), not any Error.
  • One type per file — predictable navigation, minimal merge conflicts.
  • ~Copyable by default — types opt INTO Copyable, not out of it.
  • ~Escapable for views — pointer-based views cannot outlive their base.
  • Foundation-free — no import Foundation anywhere in L1.
  • Strict memory safety.strictMemorySafety() enabled on every target; every unsafe-pointer site carries explicit unsafe vocabulary.
  • Multi-target per package — Core + variants + umbrella; consumers can import the narrow variant they need.

Each package ships with a DocC catalog documenting the above at type granularity.

Where to go next

If you want to... Go to
Read the ecosystem overview swift-institute.org
Browse the primitives monorepo swift-primitives/swift-primitives
Consume a single primitives package Find it in the list of repositories on this page and add it to your Package.swift
Browse design rationale swift-institute/Research
Report a security vulnerability See the security policy
Report an issue or contribute Open an issue or pull request on the relevant package repository

Status

Initial public alpha. Individual packages are being released repository by repository; the layer as a whole is stabilising toward a first coordinated milestone.

Maintained by Coen ten Thije Boonkkamp as a sole-contributor project. Contributions via pull request are welcome.

License

All packages in this organization use the Apache License 2.0.

Popular repositories Loading

  1. swift-render-primitives swift-render-primitives Public

    Render types for Swift.

    Swift 7

  2. swift-builder-primitives swift-builder-primitives Public

    A shared, macro-free result-builder grammar for declarative element collection, in Swift.

    Swift 4

  3. swift-logic-primitives swift-logic-primitives Public

    Logic types for Swift.

    Swift 2

  4. swift-memory-allocation-primitives swift-memory-allocation-primitives Public

    Memory.Allocator — allocators that carve a memory region (heap or inline) into slots: a passthrough System allocator, a bump Arena, and an O(1) fixed-size Pool.

    Swift 2

  5. swift-cache-primitives swift-cache-primitives Public

    Cache<Key, Value> — a thread-safe compute-if-absent async cache; concurrent callers for the same key coalesce onto a single in-flight computation.

    Swift 1

  6. swift-async-primitives swift-async-primitives Public

    Raw async coordination primitives (Channel/Broadcast/Semaphore/Mutex/Barrier/Promise/Bridge) a layer below AsyncSequence, with ~Copyable element support and typed-throws cancellation.

    Swift 1

Repositories

Showing 10 of 196 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…