Minimal ceremony. Just routes and types. 23% fewer tokens than Python's FastAPI, 57% fewer than Java.
@ GET /api/users/:id -> User | Error {
+ auth(jwt)
+ ratelimit(100/min)
% db: Database
$ user = db.users.get(id)
> user
}
GlyphLang™ is an AI-first backend programming language designed specifically for LLM code generation. Written in pure Go and compiled to a single binary, it bridges the gap between AI prompts and production-ready code. Write once in .glyph and generate working servers in Python/FastAPI, TypeScript/Express, and more.
No import flask. No app = Flask(__name__). No decorators, no wrappers, no ceremony. Routes are the entire program. This is where the token savings come from.
Compact symbols (@ $ % > +) provide a consistent, predictable structure. Every route looks the same. Every type definition follows the same pattern. Less variation means fewer mistakes.
Built-in HTTP routing, WebSocket support, database integration, JWT authentication, rate limiting, and SQL injection prevention. Everything you need, nothing you don't.
Minimal syntax means faster compilation and lower token costs
A small set of symbols keeps the syntax consistent and scannable
Each construct starts with a distinct symbol. Spot routes (@), types (:), and variables ($) instantly without reading the whole line.
Every route follows the same structure. Every type definition looks identical. Consistency makes code easier to read, write, and review.
Single-character prefixes mean less typing. No need to remember if it's "func", "function", "def", or "fn" - it's always the same symbol.
Prefer keywords? Convert between symbols and human-readable syntax instantly
glyph expand main.glyph
glyph compact main.glyphx
Comments and formatting are preserved during conversion. The .glyph format remains canonical for AI and compilation.
Every feature designed to maximize AI/LLM code generation success
Skip the boilerplate. Routes and types are the program. Less ceremony means fewer tokens and faster generation.
Every route follows the same pattern. Every type definition looks the same. Consistency makes code easier to read, write, and generate.
Minimal syntax and a focused feature set enable sub-microsecond compilation. From source to running code almost instantly.
SQL injection prevention, XSS detection, and CORS handling are built into the runtime. Security features you don't have to remember to add.
Zero-allocation VM execution in 2.93 ns/op. AI-generated code runs as fast as hand-optimized solutions.
Eliminating imports and framework boilerplate cuts token count by 23% vs FastAPI, 57% vs Java. More room in context windows for actual logic.
Built-in glyph context and glyph validate --ai commands generate structured output optimized for AI agents to understand and work with your codebase.
JSON error output with types, locations, and fix hints. Machine-readable errors make it easier for AI tools to parse and suggest fixes.
Hash-based change detection with --changed flag. Only send what changed to AI agents, minimizing token usage on updates.
Write once in .glyph, generate working servers in Python/FastAPI or TypeScript/Express. Same source, multiple targets via Semantic IR.
Define provider contracts with typed method signatures. Inject email services, payment gateways, or any external dependency with % name: Provider.
Write and run GlyphLang code directly in your browser
Click "Run Code" to see the output...
From REST APIs to real-time applications—all generated by AI
@ GET /api/posts {
% db: Database
$ posts = db.posts.all()
> {posts: posts}
}
@ GET /api/posts/:id {
% db: Database
? validate_range(id, 1, 1000000)
$ post = db.posts.get(id)
> {post: post}
}
Build production-ready REST APIs with built-in validation, security, and database integration.
@ ws /chat {
on connect {
ws.send({type: "welcome"})
}
on message {
ws.broadcast_to_room(input.room, {
text: input.text,
user: input.user,
timestamp: now()
})
}
on disconnect {
ws.broadcast({type: "user_left"})
}
}
@ GET /api/stats {
> {
connections: ws.get_connection_count(),
rooms: ws.get_room_count(),
uptime: ws.get_uptime()
}
}
Build chat apps, live notifications, and collaborative tools with first-class WebSocket support.
: User {
id: int!
name: str!
email: str!
created_at: timestamp
}
@ POST /users {
% db: Database
? validate_email(input.email)
$ user = db.users.create({
name: input.name,
email: input.email
})
> {user: user}
}
First-class database integration with PostgreSQL, MySQL, and MongoDB support.
@ GET /health {
> {status: "ok", uptime: uptime()}
}
@ POST /api/process {
+ auth(jwt)
+ ratelimit(100/min)
% queue: Queue
$ job = queue.push({
type: "process",
data: input
})
> {job_id: job.id}
}
Build scalable microservices with Docker/Kubernetes deployment configs included.
# Write once in .glyph:
: Todo { id: int!, title: str!, done: bool! }
@ GET /api/todos {
% db: Database
$ todos = db.todos.Find()
> todos
}
# Generate Python:
# glyph codegen app.glyph --lang python
# Generate TypeScript:
# glyph codegen app.glyph --lang typescript
One .glyph source file generates complete, working servers in multiple languages via the Semantic IR pipeline.
Download pre-built binaries or build from source
git clone https://github.com/GlyphLang/GlyphLang.git
cd glyph && make build
@ GET /hello/:name {
$ greeting = "Hello, " + name + "!"
> {message: greeting}
}
./glyph dev hello.glyph
# Visit http://localhost:3000/hello/world