Note
Bolt is currently in the final stages of development.
Bolt brings modern web development to Ring. It pairs an Express.js-like DSL with a Rust-powered HTTP engine, giving you a framework that is both approachable and fast. Write routes in Ring, run them on a Rust async runtime.
One line is all it takes:
load "bolt.ring"
new Bolt() { $bolt.send("Hello, World!") }A real app with routing, params, and JSON:
load "bolt.ring"
new Bolt() {
port = 3000
@get("/", func {
$bolt.send("Hello from Bolt!")
})
@get("/users/:id", func {
$bolt.json([
:id = $bolt.param("id"),
:name = "User " + $bolt.param("id")
])
})
where("id", "[0-9]+")
@post("/users", func {
data = $bolt.jsonBody()
$bolt.jsonWithStatus(201, [:created = true, :data = data])
})
}ring app.ring
# [bolt] Server running on http://0.0.0.0:3000Routing & HTTP
- All HTTP methods:
@get,@post,@put,@patch,@delete,@head,@options - URL parameters (
:id), query strings, and regex constraints (where()) - Route prefixes for clean API versioning (
prefix()/endPrefix()) - Static file serving with automatic MIME detection
Middleware & Lifecycle
- Global
@before/@afterhooks - Named middleware via
@use - Per-route middleware and rate limiting
Real-time
- WebSocket endpoints with per-client send, rooms, and broadcast
- Server-Sent Events for push updates
Security
- JWT encode / decode / verify with expiry
- Basic Auth, signed & flash cookies, CSRF tokens
- Rate limiting, IP whitelist / blacklist, CORS
- Built-in TLS / HTTPS support
Data & Templates
- In-memory sessions and key-value cache with TTL
- Multipart file uploads with save-to-disk
- MiniJinja templates (Jinja2-compatible)
- JSON parsing and encoding
Developer Experience
- Auto-generated OpenAPI docs at
/docs - Built-in brotli/gzip compression
- Request logging with configurable levels
- Homepage helper for instant landing pages
Utilities
Hash— Argon2id, bcrypt, scryptCrypto— AES-256-GCM, HMAC-SHA256Validate— Email, URL, IP, UUID, regex, JSON SchemaSanitize— HTML / XSS safe outputEnv—.envfile loadingDateTime— Formatting, parsing, arithmetic
Hello-world endpoint tested with wrk -t8 -c100 -d10s (5s warmup) on a Ryzen 9 9950x VM (12 vCPUs).
| Framework | Language | Requests/sec | vs Bolt |
|---|---|---|---|
| Actix-web | Rust | 874,706 | 2.1x faster |
| Fiber | Go | 606,122 | 1.5x faster |
| ASP.NET | .NET | 501,285 | 1.2x faster |
| Java Virtual Threads | Java | 490,197 | 1.2x faster |
| Bolt | Ring/Rust | 415,084 | — |
| Gin | Go | 360,205 | 1.2x slower |
| Bun | JS | 274,226 | 1.5x slower |
| Elysia | Bun | 267,333 | 1.6x slower |
| NestJS+Fastify/Node | JS | 78,925 | 5.3x slower |
| Express/Bun | JS | 70,071 | 5.9x slower |
| Express/Node | JS | 67,191 | 6.2x slower |
| FastAPI | Python | 2,282 | 182x slower |
ringpm install bolt from ysdragonRequirements
- Ring 1.27+
- Pre-built binaries included for Windows, Linux (glibc / musl), macOS, and FreeBSD
| # | Example | What it shows |
|---|---|---|
| 01 | hello | Basic routes, JSON, params |
| 02 | http_methods | All HTTP verbs |
| 03 | route_params | URL params, query strings, constraints |
| 04 | request_response | Headers, body, cookies |
| 05 | json_api | RESTful CRUD API |
| 06 | static_files | Serving directories |
Browse the full set in examples/.
- Usage Guide — Feature-by-feature guide with complete code examples
- API Reference — Every method, every class, every parameter
new Bolt() {
port = 3000
host = "0.0.0.0"
# Limits
setBodyLimit(50 * 1024 * 1024)
setTimeout(30000)
setSessionCapacity(10000)
setSessionTTL(300)
setCacheCapacity(50000)
setCacheTTL(600)
# Security & features
enableCors()
enableCompression()
enableLogging()
enableDocs()
homepage()
# Routes...
}Issues and pull requests are welcome!
MIT License — see LICENSE for details.
