β οΈ Alpha Software: Doo is in active development. Expect bugs and breaking changes. Not recommended for critical production use yet.
Doo is a statically-typed, compiled programming language built in Rust + LLVM, designed for building production APIs quickly and safely. It uses automatic memory management via reference counting.
Stop wrestling with boilerplate. Write type-safe APIs and deploy with one command.
// main.doo - Your entire API
import std::Http::Server;
import std::Database;
struct User {
id: Int @primary @auto,
email: Str @email @unique,
password: Str @hash,
}
struct Todo {
id: Int @primary @auto,
title: Str @min(3),
done: Bool @default(false),
}
fn main() {
let db = Database::postgres()?;
let app = Server::new(":3000");
// Authentication via JWT
app.auth("/signup", "/login", User, db);
// Full CRUD
// GET, POST, GET/:id, PUT/:id, DELETE/:id
app.crud("/todos", Todo, db);
app.start();
}Run it:
doo run # Compiles to native + starts server| Traditional Stack | Doo |
|---|---|
| 500+ lines of boilerplate | 20 lines of code |
| 3 config files | Zero config |
| Manual validation | Auto-validated decorators |
| Separate deployment setup | One command deploy |
| Type mismatches at runtime | Compile-time safety |
irm https://raw.githubusercontent.com/nynrathod/doolang/main/install.ps1 | iexcurl -fsSL https://raw.githubusercontent.com/nynrathod/doolang/main/install.sh | bashdoo --helpdoo init --template starter starter-api
cd starter-api
doo rundoo init --template blog blog-api # Blog posts + comments API
cd blog-api
doo runVisit http://localhost:3000 - your API is live.
Complete task management API with auth, CRUD, and custom queries:
import std::Http::Server;
import std::Database;
enum Status { Todo, InProgress, Done }
enum Priority { Low, Medium, High }
struct User {
id: Int @primary @auto,
email: Str @email @unique,
password: Str @hash @min(8),
}
struct Task {
id: Int @primary @auto,
title: Str @min(1) @max(200),
status: Status @default(Status::Todo),
priority: Priority @default(Priority::Medium),
userId: Int @foreign(User),
}
fn GetUrgent() -> [Task] ! DatabaseError {
let db = Database::get()?;
let result: [Task] = db.rawWithParams(
"SELECT * FROM tasks WHERE priority = $1 AND status != $2",
[Priority::High, Status::Done]
)?;
Ok result;
}
fn main() {
let db = Database::postgres()?;
let app = Server::new(":3000");
app.auth("/signup", "/login", User, db);
app.crud("/tasks", Task, db);
app.get("/tasks/urgent", GetUrgent);
app.start();
}That's it. 30 lines for a production-ready API with:
- β User authentication with JWT
- β Password hashing
- β Struct validation
- β Full CRUD operations
- β Custom business logic
- β Auto error propagation
- β Auto migrate table on startup
let name = "Alice"; // Type inferred
let age: Int = 25; // Explicit
let mut count = 0; // Mutable| Type | Example |
|---|---|
Int |
42 |
Float |
3.14 |
Str |
"hello" |
Bool |
true |
[T] |
[1, 2, 3] |
{K: V} |
{"a": 1} |
struct User {
id: Int @primary @auto,
email: Str @email @unique,
password: Str @hash @min(8) @max(20),
age: Int @min(18),
}
// Automatically create table on startup
struct AuditLog @table {
id: Int @primary @auto,
action: Str
}fn divide(a: Int, b: Int) -> Int ! Str {
if b == 0 { Err "division by zero"; }
Ok a / b;
}
let result = divide(10, 2)?; // Auto-propagate errorsfn GetUser(id: Int) -> User ! DatabaseError {
let db = Database::get()?;
Ok db.query("SELECT * FROM users WHERE id = $1", id)?;
}
app.get("/users/:id", GetUser);Full language guide: See examples/ folder for complete tutorials
- tasks_api - Complete CRUD + Auth + Custom queries
- calculator - Error handling patterns
- clean_code - Service layers & validation
More examples: examples/
- GitHub Discussions: Ask questions, share projects
- Issues: Bug reports and feature requests
- Contributing: We welcome PRs! See CONTRIBUTING.md
We're focused on adoption first. Next features will be driven by real developer needs:
- More cloud providers + zero-config hosting
- Multi-database support (MySQL, SQLite etc)
- WebSocket, concurrency, async and many more
Want to influence the roadmap? Open a discussion β
This project is licensed under the MIT License
- LLVM Project: For the powerful backend infrastructure
- Rust Community: For inspiration and excellent tooling
Ready to ship faster? doo init starter β Start here
Want to contribute? See CONTRIBUTING.md
For testing and development: See TEST.md