Odin

1 program Added 2025-10-22T10:08:02Z Model: anthropic/claude-3.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: odin-lang
Provenance: commit 9157db4fc9 · authored 2025-10-22T12:08:02+02:00 · model anthropic/claude-3.5-sonnet

Sources mentioning this language

6 sources · pl_id: pl/odin
LLM (this repo) · 1PldbLinguistPygmentsHyperpolyglotRosettacode

Extensions claimed by this language

2 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.odinlinguistprimary44.0K files
.odinpygmentsprimary44.0K files

Related languages

Oden (0.53)Opal (0.30)Wren (0.30)Yron (0.30)rk (0.26)

LLM-contributed programs

Simple Snake Game

Provenance: commit 9157db4fc9 · authored 2025-10-22T12:08:02+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
code.odin · license: BSD-3-Clause · added: 2025-10-22T10:08:02Z
package snake

import "core:fmt"
import "core:math/rand"
import "vendor:sdl2"

WINDOW_WIDTH :: 800
WINDOW_HEIGHT :: 600
TILE_SIZE :: 20

Direction :: enum {
    UP,
    DOWN,
    LEFT,
    RIGHT,
}

Snake :: struct {
    x, y: i32,
    dx, dy: i32,
    direction: Direction,
    length: i32,
    tail_x: [100]i32,
    tail_y: [100]i32,
}

main :: proc() {
    sdl2.Init(sdl2.INIT_VIDEO)
    window := sdl2.CreateWindow("Snake", sdl2.WINDOWPOS_CENTERED, sdl2.WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, sdl2.WINDOW_SHOWN)
    renderer := sdl2.CreateRenderer(window, -1, sdl2.RENDERER_ACCELERATED)

    snake := Snake{
        x = WINDOW_WIDTH/2,
        y = WINDOW_HEIGHT/2,
        dx = TILE_SIZE,
        dy = 0,
        direction = .RIGHT,
        length = 1,
    }

    food_x := rand.int31_max(WINDOW_WIDTH/TILE_SIZE) * TILE_SIZE
    food_y := rand.int31_max(WINDOW_HEIGHT/TILE_SIZE) * TILE_SIZE

    game_over := false
    for !game_over {
        event: sdl2.Event
        for sdl2.PollEvent(&event) {
            #partial switch event.type {
            case .QUIT:
                game_over = true
            case .KEYDOWN:
                #partial switch event.key.keysym.sym {
                case .UP:
                    if snake.direction != .DOWN {
                        snake.direction = .UP
                        snake.dx = 0
                        snake.dy = -TILE_SIZE
                    }
                }
            }
        }
    }
}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.odin/1.odinpredicates[{"kind": "any", "regexes": ["package\\s+\\w+|\\b(?:im|ex)port\\s*\"[\\w:./]+\"|\\w+\\s*::\\s*(?:proc|struct)\\s*\\(|^\\s*//\\s"]}]

Contribute — propose a file extension

Tell us where to find evidence about Odin (mapped to pl/odin). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Odin/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Oden odrl →