glyph
Health Warn
- License — License: Apache-2.0
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 8 GitHub stars
Code Fail
- rm -rf — Recursive force deletion command in .github/workflows/ci.yml
- fs module — File system access in .github/workflows/ci.yml
- rm -rf — Recursive force deletion command in .github/workflows/playground.yml
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
A statically typed, transpile-to-TypeScript language designed so AI agents can read, write, and modify code safely.
Glyph
A statically typed, transpile-to-TypeScript language built so code an AI agent writes can be read, checked and changed without guessing.
npm install -g @glyphlang/glyph
glyphlang.io · playground · AGENTS.md if you are pointing an agent at this
What it looks like
module main
import std/array
import std/option { Some, None }
import std/result { Result, Ok, Err }
type User = {
id: string,
name: string,
}
pub fn find_user(users: Array<User>, id: string) -> Result<User, string> {
let found = array.find(users, fn(u: User) -> bool {
return u.id == id
})
return match found {
Some(u) => Ok(u),
None => Err("no user with id ${id}"),
}
}
If you write TypeScript you can read that on day one. That is the point: Glyph
compiles to TypeScript, runs anywhere TypeScript runs, and uses npm packages
directly. The differences are few and each one exists so that a program stays
correct when something other than its author changes it.
What the compiler catches
Add a variant to a union and every match over it stops compiling until you
handle the new case. This is the whole idea in one error:
type PaymentStatus =
| Pending
| Settled({ cents: int })
| Refunded({ cents: int })
[E0200] non-exhaustive match on `PaymentStatus`: missing variants `Refunded`
Help: Add an arm for each missing variant.
Note: Tagged unions are sealed (D9): adding a variant forces every match to
be updated. A `_`/`else` catch-all is allowed but forfeits that
guarantee.
An agent adding a payment state cannot quietly leave a branch unhandled, because
the build stops. In TypeScript the same change compiles and fails later, at a
customer.
Why not just TypeScript
TypeScript is the thing to beat, and mostly Glyph does not try to. It keeps the
ecosystem and changes the layer above it. What changes, and why:
| TypeScript | Glyph | Why it matters when a machine is editing |
|---|---|---|
any erases what the type says |
no any |
an agent cannot satisfy the checker by escaping it |
| exceptions are invisible in a signature | errors are values in the return type | what can fail is readable without running anything |
a switch can silently miss a case |
match must be exhaustive |
adding a variant surfaces every site that must change |
| several ways to declare the same thing | one form per declaration | grep "fn parse_user" finds the definition, always |
| formatting is a matter of taste | formatting is fixed | a one-line change makes a one-line diff |
| types are erased before runtime | types carry a runtime descriptor | untrusted input is validated at the boundary, not cast |
Every one of those is a property an agent depends on and a human merely
appreciates. That asymmetry is the bet.
The four pillars
Every design decision is tested against these. If a feature improves one without
harming the others, it ships.
- Verifiability. Anything the type system claims is true at runtime. No
any, no casts, and a value crossing a boundary is checked against its type
on the way in:json.parse<User>(body)isOkonly if the body really is aUser, and a type Glyph cannot check at runtime is refused rather than
trusted. - Greppability. Every symbol has one syntactic form at its declaration
site: no overloads, no renaming decorators, no implicitthis, no
declaration merging.grepfinds the definition. - Abstraction. Express intent at the level the writer is thinking: pattern
matching overif/elseladders,Resultover thrown exceptions, named
records over positional tuples. - Diff stability. A one-line change produces a one-line diff.
glyph fmt
has one layout and no options, and the layout depends only on the code, not
on how the input happened to be wrapped.
Verifiability and greppability are the wedge. Abstraction and diff stability are
the polish.
These are properties of the language rather than of a project's settings.
Strict TypeScript with lint rules and Prettier gets part of the way in one
repository; Glyph makes them true of every file, so an agent opening an
unfamiliar codebase does not have to find out which settings it chose. The
manifesto (docs/manifesto.md) goes through each pillar against that
objection.
Status
Pre-1.0 and moving. The compiler, standard library, formatter, LSP and MCP
server are usable now: the applications under examples/apps/
are real programs written in Glyph with no TypeScript in them, and each carries
a README saying what writing it found in the compiler.
What that means for you: the language works, and 0.1.x releases can still reject
code that compiled before. Read the release notes
before moving between versions, and pin the compiler in devDependencies, whichglyph init does for you.
Editor support
The TextMate grammar and a VS Code extension live ineditors/vscode/. Neither is on the Marketplace yet, so
install it from source:
cd editors/vscode && npx @vscode/vsce package && code --install-extension glyph-vscode-*.vsix
The grammar is generated from the lexer's keyword table, so a keyword the
compiler knows is a keyword the editor colours. Any editor with an LSP client
can drive glyph lsp over stdio for diagnostics, hover, go-to-definition,
completion, find-references and rename.
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 |
| Talk to a real database (SQLite, Postgres, Mongo, Redis, MySQL) | docs/guide/databases.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 lets through |
catches/ |
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.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found