Swift Prism is a macOS app for exploring how source code becomes a running program. It is built for learning and investigation: you can watch a small teaching language move through a full compiler pipeline, or capture output from a real Swift toolchain installed on your Mac.
https://apps.apple.com/sg/app/compiler-prism/id6782965485
Lab — source, pipeline map, stage output, and inspector.
Swift Prism uses two modes on purpose. They solve different problems, and the app keeps them clearly separate so results are never mixed up.
The Prism language is a small language designed for education. It is not Swift. Every compiler stage is open to inspection:
- Read source — tokens and structure linked back to the text you wrote
- Check meaning — names, types, scopes, and errors
- Lower to intermediate form — a simplified internal representation
- Optional teaching optimizations — for example folding constants, with a clear before/after record
- Lower to bytecode — instructions for Prism’s own virtual machine
- Run and step — Trace mode lets you step, rewind, and inspect values
Use teaching mode when you want to learn how a compiler is put together, or to follow a program line by line without installing multiple Swift versions.
On macOS, Prism can run a real Swift compiler you already have—typically from Xcode or Swiftly. That path does not reimplement Swift. It records what the real compiler produces:
- Diagnostics (errors and notes)
- Frontend structure summaries
- SIL (Swift Intermediate Language) as text, with function/block inventory,
optional ownership/type hints, and
loc→ source linkage when present - Structured LLVM IR and assembly summaries plus raw dumps
- Diff — line Diff (cached LCS) and structural SIL inventory Diff
- Optional Mach-O evidence and a representative driver job graph
Dumps are cleaned up where possible (paths, module-cache banners, ordering) so comparisons are more stable. Structure is a summary, not a reimplementation of the Swift type system.
Use authentic mode when you want evidence from the real toolchain—for example comparing two Swift versions, or browsing SIL differences in a visual workspace.
| Workspace | Role |
|---|---|
| Learn / Library / Forensics | Product modes that reshape sidebar defaults |
| Lab | Edit source and inspect the teaching pipeline |
| Architecture | Map of compiler phases (teaching and authentic) |
| Diff | Compare authentic Swift output across toolchains |
| Trace | Step the teaching VM (step / over / out / source / continue) |
Teaching results are never presented as “live Swift compilation.” Authentic output is labeled as coming from a real toolchain.
Diff — compare real toolchain output (for example SIL) across versions.
- Native macOS app (SwiftUI); teaching path builds for iOS 17+ as well
- First-run welcome with an honest dual-mode explainer; reopenable anytime
- Built-in Help Center: searchable topics for concepts, workspaces, toolchains, and what is simulated vs. authentic
- Always-visible status bar: engine state, diagnostic counts, active stage, and result provenance on every workspace
- Menu-bar Workspace menu with ⌘1–⌘4 switching; sidebar rows explain what each workspace does, and diagnostics jump to the offending source line
- Teaching compiler with inspectable stages and a stepable virtual machine
- Real Swift toolchain capture, multi-toolchain Diff, SIL/LLVM/asm structure
- Toolchain discovery and optional Swiftly install management
- Companion CLI (
prism-companion watch) for exchange-based host compilation .compileprismdocument packages for project persistence- Clear UI about what is fully inspectable versus raw compiler text
- macOS 14 or later
- Xcode (or Command Line Tools) for the macOS SDK when using authentic Swift stages
- Optional: Swiftly for managing Swift toolchains
# Run package tests
cd CompilerAtlas
swift test# Open the app in Xcode (schemes: Prism = macOS, Prism iOS = teacher mode)
open CompilerAtlas.xcodeprojOr build from the command line:
# macOS app
xcodebuild -project CompilerAtlas.xcodeproj -scheme Prism -configuration Debug build
# iOS teacher-mode app (simulator)
xcodebuild -project CompilerAtlas.xcodeproj -scheme "Prism iOS" \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' buildPrism iOS is a self-contained teaching app: the synthetic Prism pipeline
only — Lab, Architecture, and Trace. It runs the teaching language
(version PrismSemantics.languageVersion, currently 1.1) entirely on-device
with no toolchain setup, and every result is labeled Prism · live. The
Help Center lists the exact supported language surface and what the pipeline
deliberately does not claim.
| Path | Purpose |
|---|---|
CompilerAtlas/ |
Shared Swift package (language, tools, UI library, tests) |
CompilerAtlasMac/ |
macOS application target |
CompilerAtlasIOS/ |
iOS teacher-mode application target (teaching pipeline only) |
CompilerAtlas.xcodeproj |
Xcode project — schemes Prism (macOS) and Prism iOS |
docs/images/ |
Screenshots used in this README |
docs/privacy-policy.md |
Privacy policy |
docs/ROADMAP.md |
Roadmap (completed backlog + residual limits) |
docs/sandbox-mas.md |
Mac App Store sandbox / toolchain access |
docs/investigation/ |
#89581 localization notes |
scripts/ci/linux-container-nightly.sh |
Optional Linux / container nightly lane |
LICENSE |
Dual license terms |
Swift Prism is designed to keep your work on your machine. See docs/privacy-policy.md.
Ideas and pull requests are welcome. Longer-term ideas are listed in docs/ROADMAP.md.
See LICENSE for full dual-license terms (noncommercial public use and separate commercial licensing).

