Glyph
A statically typed, transpile-to-TypeScript language designed so AI agents can read, write, and modify code safely.
Glyph looks almost like TypeScript. A TS developer reads a Glyph file on day one without a tutorial. The differences are deliberate and small in number, and every one of them exists to make code an agent can reason about correctly, edit without breakage, and explain back to a human without lying.
npm install -g @glyphlang/glyph
Website: glyphlang.io · Try it: playground · Building with an AI agent? Point it at AGENTS.md / glyphlang.io/llms.txt — one file that takes an agent from zero to correct, runnable Glyph.
The four pillars
Every design decision is tested against these. If a feature improves one without harming the others, it ships. If not, it doesn't.
- Abstraction — express intent at the level the writer is thinking. Pattern matching over switch ladders,
Resultover thrown exceptions, named records over positional tuples. - Verifiability — anything the type system claims must be true at runtime. No
any. No structural-typing surprises. No type erasure. - Diff stability — a one-line change produces a one-line diff. Fixed-width, single-element-per-line formatting. No barrel files. Trailing commas everywhere.
- Greppability — every symbol has exactly one syntactic form at its declaration site.
grep -n "fn parseUser"finds the definition. Always.
Verifiability and greppability are the wedge. Abstraction and diff stability are the polish.
Why Glyph
- Built for AI agents. They can read, write, and change code safely.
- Looks like TypeScript. You can read it on day one, no tutorial.
- Compiles to TypeScript. It runs anywhere TS runs and uses any npm package.
- No
any. What the types say is true when the code runs. - One name, one form.
grepalways finds where something is defined. - Errors are values, not exceptions. You handle them with
match. matchmust cover every case. The compiler tells you what you missed.- A one-line change makes a one-line diff. Reviews stay small.
- Tests live next to the code. They run on every build.
- Clear error messages. Each one tells you how to fix the problem.
Where to start
| If you want to | Read |
|---|---|
| See the whole language in five minutes | docs/guide/tour.md |
| Install Glyph and run your first program | docs/guide/getting-started.md |
| Map your TypeScript knowledge onto Glyph | docs/guide/for-typescript-developers.md |
| Build something real (a todo CLI) | docs/guide/tutorial.md |
| Understand the project's thesis | docs/manifesto.md |
| See concrete Glyph programs | examples/ |
| Read the language specification | docs/language/spec.md |
| See the roadmap | docs/roadmap/overview.md |
| See the full implementation plan | docs/implementation-plan.md |
| Compare Glyph against TS, Python, Rust | benchmarks/ |
| See what the benchmarks show (honestly) | benchmarks/FINDINGS.md |
See bugs Glyph catches that tsc --strict misses |
benchmarks/verifiability/ |
Building
cd glyph-compiler
cargo test --workspace
Requires Rust 1.95 or later (pinned via rust-toolchain.toml).
Verifying a release
Releases are built in GitHub Actions and published with provenance:
npm audit signatures # npm packages (OIDC provenance)
gh attestation verify glyph-<version>-<platform>.tar.gz --repo chadetov/glyph # SLSA attestation
sha256sum -c SHA256SUMS # per-archive checksums
License
Dual-licensed under either of
at your option.