Working code for every AID feature. Copy, build, run.
Every example compiles and runs. No mock data, no pseudocode — real AID programs you can use as starting points.
Minimal HTTP server with text and JSON routes. The simplest possible AID app.
server.get("/") => fn(req) -> Response {
Response.text("Hello from AID")
}
Getting Started
Every language feature in one file — reason blocks, evolve, contracts, entities, all HTTP methods.
// entities, reason, evolve, contracts
// All in ~200 lines
Getting Started
Compile to WebAssembly with aid build --target wasm. Deploy to edge, cloud, or browser.
// $ aid build --target wasm
// → wasm32-wasip1 binary
SQLite product store with CREATE, READ, UPDATE, DELETE endpoints, migrations, and aggregation queries.
db.connect("sqlite://products.db")
db.migrate("migrations/")
products := db.query("SELECT * FROM products")
std.env
.env loading, required vs optional variables, config inspection endpoints, and best practices.
env.load_dotenv()
port := env.require("PORT")
name := env.get("APP_NAME")
std.auth
Complete auth flow: registration with bcrypt, login with JWT, protected routes, API key validation.
hash := auth.hash_password(password)
token := auth.jwt_sign(claims, secret)
auth.middleware(protected_handler)
std.html
Multi-page web app with templates, variable interpolation, loops, conditionals, static files, and redirects.
content := html.template("page.html", data)
html.render(content)
html.redirect("/")
Support ticket classifier with AI reasoning and self-improving telemetry tracking.
reason classify_ticket(text) -> string {
goal: "Classify a support ticket"
fallback: "general"
}
AI
Natural language rules compiled to type-safe validators. Describe validation in English.
contract ValidEmail {
rule: "Must contain @ symbol"
rule: "Cannot be empty"
}
AI
AI-native HTTP routing. The compiler analyzes your handlers and builds route tables at compile time.
// Compiler auto-discovers handlers
// Builds routes at compile time
AI
Local LLM-powered reason blocks via the Cortex sidecar. No cloud, no API keys.
// $ aid cortex pull
// $ aid cortex serve
// → LLM-powered reason blocks