Harn
Harn is a pipeline-oriented programming language for orchestrating AI coding agents. It has native LLM calls, tool use, structured output, and async concurrency built into the language.
pipeline default(task) {
let tools = tool_registry()
|> tool_add("search", "Search the web", search_fn, {query: "string"})
let result = llm_call(task, "You are a research assistant", {
tools: tools,
response_format: "json",
})
log(result.data)
}
Getting started
Prerequisites
Harn is built with Rust. You’ll need:
- Rust (1.70 or later) — install with
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Git
Install from source
git clone https://github.com/burin-labs/harn
cd harn && cargo build --release
cp target/release/harn ~/.local/bin/
Create a project and run it:
harn init my-agent
cd my-agent
export ANTHROPIC_API_KEY=sk-...
harn run main.harn
What’s in this guide
- Why Harn? – What problems Harn solves and how it compares to existing approaches
- Language Basics – Syntax, types, control flow, functions, structs, enums
- Error Handling – try/catch, Result type, the
?operator, retry - Modules and Imports – Splitting code across files, standard library
- Concurrency – spawn/await, parallel, channels, mutexes, deadlines
- LLM Calls and Agent Loops – Calling models, agent loops, tool use
- Builtin Functions – Complete reference for all built-in functions
- Cookbook – Practical recipes and patterns