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

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 versionPrint the version

Docs and status

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.

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.