Factory.ai

Open-Source Wikis

/

Swift

/

Swift project overview

/

Glossary

apple/swift

Glossary

Project-specific vocabulary. The fuller, canonical reference lives in docs/Lexicon.md.

Compiler pipeline

  • Driver — the swift/swiftc binary that supervises a build (file discovery, job planning, calling the frontend, linking). Implemented in lib/Driver/ and lib/DriverTool/.
  • Frontendswift -frontend, the per-invocation compiler that parses, type-checks, generates SIL, optimizes, and emits LLVM IR. Implemented in lib/Frontend/ and lib/FrontendTool/.
  • Request evaluator — a generic memoization graph over typed requests; the backbone of lazy type checking. See docs/RequestEvaluator.md and lib/AST/Evaluator.cpp.
  • Subsystems — the high-level entry points of each pass. See include/swift/Subsystems.h.

AST and types

  • AST — abstract syntax tree, the parsed and type-checked program representation. Code in lib/AST/.
  • Decl — a declaration node (FuncDecl, StructDecl, ...). Defined in include/swift/AST/Decl.h.
  • Expr / Stmt — expression / statement nodes.
  • TypeRepr — a syntactic type as written by the user (before type checking).
  • Type — a canonical resolved type. CanType is the canonical form.
  • Archetype — placeholder for a generic parameter or associated type within a generic context.
  • Substitution — a mapping from generic parameters to concrete types.
  • Conformance — the witness that a type satisfies a protocol; ProtocolConformance in C++.
  • GenericSignature — the requirements (where-clauses) on a set of generic parameters. Computed by the requirement machine in lib/AST/RequirementMachine/.
  • Sugared type — a type with surface syntax preserved (e.g., [Int] vs Array<Int>).

Constraint system

  • CSGen / CSSimplify — constraint generation and constraint simplification (lib/Sema/CSGen.cpp, CSSimplify.cpp).
  • TypeVariable — a placeholder during constraint solving.
  • Solution — an assignment of types to type variables that makes all constraints hold.
  • Disjunction — a constraint with multiple alternatives, used for overload resolution.

SIL

  • SIL — Swift Intermediate Language. SSA-form IR between AST and LLVM IR. See docs/SIL/.
  • Raw SIL — SIL fresh from SILGen, before mandatory passes have run.
  • Canonical SIL — SIL after mandatory passes; valid input to IRGen.
  • Mandatory passes — passes that the language semantics require (definite initialization, ARC ownership lowering, mandatory inlining, ...). Run regardless of -O.
  • Performance passes — optimizations enabled by -O / -Osize / -Owholemodule.
  • Ownership SIL (OSSA) — SIL with explicit ownership annotations (owned, guaranteed, unowned). All raw and canonical SIL is OSSA today.
  • Function signature — calling-convention info: parameter ownership, indirect/direct passing, error result, etc.

IRGen and runtime

  • IRGen — lowering canonical SIL to LLVM IR. Code in lib/IRGen/, header API in include/swift/IRGen/.
  • Type metadata — runtime descriptors for types (size, alignment, generic args, conformances). Created/looked up in stdlib/public/runtime/Metadata.cpp.
  • Witness table — runtime table of protocol-method implementations for a particular (type, protocol) pair.
  • Existential container — boxed representation of a protocol-typed value (Any, any P).
  • Heap object — a Swift class instance, prefixed with metadata + reference counts. See stdlib/public/runtime/HeapObject.cpp.
  • Demangler — turns mangled symbols (e.g., $s4main3FooV3barfoo) into readable names. Implemented twice: a host-side library in lib/Demangling/ and a runtime-side copy compiled into the runtime.

ClangImporter and module system

  • ClangImporter — the embedded Clang instance that imports C and Objective-C declarations as Swift APIs. Code in lib/ClangImporter/.
  • .swiftmodule — binary serialized representation of a Swift module. Code in lib/Serialization/.
  • .swiftinterface — textual stable interface used for module evolution. Generated/loaded via lib/Frontend/ModuleInterfaceLoader.cpp.
  • Overlay — a Swift module that augments a C/Objective-C framework (e.g., the Foundation overlay).
  • Cross-import overlay — a module that auto-imports when two specific modules are imported together.

ABI and runtime concepts

  • MangledName — stable encoded symbol; see docs/ABI/Mangling.rst.
  • Reabstraction thunk — small wrapper used when a value's [abstraction pattern] needs to change at a call boundary.
  • Type layout — physical layout (size/stride/alignment, extra inhabitants). See docs/ABI/TypeLayout.rst.
  • Resilience — ABI-stable evolution mechanism; resilient types/fields are accessed indirectly so the layout can change. See docs/LibraryEvolution.rst.
  • Library evolution — the policy + machinery that allows binary-stable libraries to evolve without breaking clients. Enabled with -enable-library-evolution.

Concurrency

  • Actor — reference type with isolated mutable state and async message-style access. Code in stdlib/public/Concurrency/Actor.cpp and Actor.swift.
  • Task — unit of asynchronous work. stdlib/public/Concurrency/Task*.{cpp,swift}.
  • Executor — runs tasks; can be serial (an actor's executor) or global. See Executor.swift.
  • Sendable — protocol marking types safe to share across concurrency domains.
  • Continuation — captured suspension point, used to bridge callback-based APIs.

Tools

  • SourceKit — out-of-process IDE service used by Xcode and sourcekit-lsp. Code in tools/SourceKit/.
  • swift-syntax — the Swift-implemented syntax tree library; used in lib/ASTGen/, macros, and refactoring.
  • gyb — "Generate Your Boilerplate", the Python templating system for repetitive stdlib code (utils/gyb.py). Files end in .gyb.

Build and contribution

  • build-scriptutils/build-script, the Python entry point for building everything.
  • Preset — a named bundle of build-script arguments in utils/build-presets.ini.
  • @swift_ci — the CI bot. Comment @swift_ci please test on a PR to trigger CI. See docs/ContinuousIntegration.md.
  • update-checkoututils/update-checkout clones / updates the side-by-side repos at compatible revisions.

For terms not listed here, search docs/Lexicon.md or the LLVM lexicon.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Glossary – Swift wiki | Factory