750/750 Tests Passing
Zero Dependencies

Swift Compiler
for the Web

Write and run Swift in your browser. A complete compiler pipeline — Lexer, Parser, Semantic Analysis, IR, SSA, WASM — built from scratch in C.

main.swift
Press Run or Cmd+Enter...

Open full playground for live diagnostics and hover tooltips.

71K
Lines of C
750
Tests Passing
508
Swift Types
0
Dependencies

Everything You Need to Run Swift

Full Language Support

Structs, classes, enums, protocols, generics, closures, async/await, error handling, pattern matching — all compiled to WebAssembly.

Standard Library

Array, Dictionary, Set, String (Unicode 17.0), Optional, Result, Range — 290 runtime functions with 180+ inlined method handlers.

WebAssembly Backend

Direct IR-to-WASM compilation. No LLVM, no clang, no Binaryen. Structured control flow, dead code elimination, constant folding.

Plugin Architecture

Modular design: compiler core knows zero about stdlib. Modules register type declarations, IR handlers, and WASM builtins via plugin API.

Web Playground

Monaco editor with custom Swift theme, live diagnostics, hover tooltips, Cmd+Enter to run. Fully offline — no server needed.

750 Tests, 100% Pass

Comprehensive test suite covering collections, concurrency, generics, error handling, strings, numerics. Zero regressions policy.

Compiler Pipeline

.swift
Lexer
Parser
Sema
IR Gen
SSA
Optimizer
WASM
.wasm