Odin programming language development workflow. Use when: - Writing or modifying Odin code (.odin files) - Building Odin projects - Debugging Odin applications - Need Odin-specific idioms and patterns
# Build for debug
odin build src -out:build/app -debug
# Build optimized release
odin build src -out:build/app -o:speed
# Run tests
odin test src -out:build/test
# Check without building
odin check src
# Build and run
odin run src
project/
├── src/
│ ├── main.odin # Entry point (package main)
│ └── module/ # Sub-packages
│ └── mod.odin
├── vendor/ # Third-party dependencies
├── build/ # Build output (gitignored)
├── Makefile # Build automation
└── ols.json # Language server config
// Return tuple with success bool
load_file :: proc(path: string) -> ([]u8, bool) {
data, ok := os.read_entire_file(path)
return data, ok
}
// Use Maybe for explicit optionality
find_item :: proc(list: []Item, id: int) -> Maybe(Item) {
for item in list {
if item.id == id do return item
}
return nil
}
// Perfect for GBA hardware registers
Status_Register :: bit_field u16 {
mode: u8 | 3, // bits 0-2
enabled: bool | 1, // bit 3
priority: u8 | 2, // bits 4-5
_reserved: u8 | 10, // bits 6-15
}
Handler :: #type proc(ctx: ^Context, data: u32)
@(private="file")