rid·dim /ˈrɪd.ɪm/ · noun, Jamaican Patois · The rhythm a song is built on. One riddim carries many voices.
A small language for code that agents write and people review.
It reads like a small Rust, compiles to readable Go, and stops what agents most often get wrong before it reaches you: nil, ignored errors, missed cases, and code that touches files or the network without being handed the right to.
enum Shape {
Circle(radius: Float),
Rect(w: Float, h: Float),
}
fn area(s: Shape) -> Float {
match s {
Circle(r) => 3.14159 * r * r,
Rect(w, h) => w * h,
}
}
fn main(sys: Sys) {
let shapes = [Shape::Circle(1.0), Shape::Rect(2.0, 3.0)]
for s in shapes {
sys.out.println(area(s).to_string())
}
}
Why Riddim
-
Cheap to check
Every diagnostic has a code, an exact place and, where it can, a fix a tool can apply. An agent fixes its own code in milliseconds, before a reviewer spends a token on it.
-
Small enough to learn from the prompt
The whole language reference is kept under about 6,000 tokens, so even a small local model can carry it.
-
Code can only touch what it's handed
Files, the environment and the clock reach a function only as parameters. A signature tells you what the code can do, and a change that widens it stands out in review.
-
Go underneath
Riddim compiles to readable Go, so you keep Go's speed, tooling, cross-compiling and packages.
A mistake, caught with its fix
Leave a case out of a match, and riddim check says so, where, and how to fix it:
main.rdm:7:5: error[R0401]: match on Shape is missing 1 case: Rect(_, _)
|
7 | match s {
| ^^^^^^^
= fix: add the missing arm: `Rect(_, _) => todo(),`
riddim check --json gives the same in JSON, with the fix as an edit a tool can apply.
Install
Riddim needs Go 1.27 or newer.
go install github.com/irie-people/riddim/cmd/riddim@latest
riddim check [dir] [--json] | Check every .rdm file in dir (default .) |
|---|---|
riddim build [dir] [-o out] | Check, write Go into dir/.riddim/go, then go build |
riddim run [dir] [-- args] | Build, then run the program with args |
riddim emit [dir] [-o gen] | Write the generated Go and stop |
riddim version | Print the version |
Docs and status
- The language reference, short enough to put in a prompt
- Every error code, with its fix
- The design and the plan
- Examples
0.1.0 is the first release: the v0 language, its checker and the Go it compiles to. Next in the plan are riddim fmt, riddim fix, and test blocks with fake capabilities. Riddim is built for Irie, which runs many coding agents side by side.
Free, and paid back
If Riddim ever makes money (donations, sponsorships, grants), it all goes back to the people who build it, after running costs, in proportion to the value of what they contributed. The record is public: irie-people/riddim-stake. It runs on Steak.