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 a high-level function/block overview when possible
- LLVM IR and assembly as text dumps
- Diff — compare the same stage across two toolchains side by side
Dumps are cleaned up where possible (paths, ordering) so comparisons are more stable. Structure for SIL is a summary, not a full model of every SIL type and ownership detail.
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 |
|---|---|
| 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 language’s virtual machine |
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 compiler with inspectable stages and a stepable virtual machine
- Real Swift toolchain capture and multi-toolchain Diff
- Toolchain discovery and optional Swiftly install management
- 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 (scheme: Prism)
open CompilerAtlas.xcodeprojOr build from the command line:
xcodebuild -project CompilerAtlas.xcodeproj -scheme Prism -configuration Debug build| Path | Purpose |
|---|---|
CompilerAtlas/ |
Shared Swift package (language, tools, UI library, tests) |
CompilerAtlasMac/ |
macOS application target |
CompilerAtlas.xcodeproj |
Xcode project — scheme Prism |
docs/images/ |
Screenshots used in this README |
docs/privacy-policy.md |
Privacy policy |
docs/ROADMAP.md |
Possible future work |
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).

