No description
  • Odin 93.7%
  • Zig 2.6%
  • Rust 2.1%
  • Shell 0.9%
  • JavaScript 0.6%
Find a file
Be Dangerous 0a6ce8c505
Some checks failed
build / linux-x86_64 (push) Successful in 4m53s
build / macos-arm64 (push) Has been cancelled
wasm_bind / check_wasm_bind (macos arm64) (push) Has been cancelled
Merge branch 'wasm-bind-idl-features'
Land wasm_bind browser IDL/export support: kernel freeze, WebIDL resolve
and emit, WebRef DOM/fetch goldens, package manifests with budgets, and
scripts/check_wasm_bind.sh gate (all green).
2026-07-10 00:15:53 -05:00
.forgejo/workflows ci: wasm_bind check gate and workflow 2026-07-09 22:15:15 -05:00
backend-cranelift cranelift JIT: static storage for file-scope &CompoundLit initializers 2026-06-11 22:48:58 -05:00
backend-llvm backend-llvm: cut module.odin + proc.odin over — all codegen now on compiler:ast 2026-06-11 08:31:09 -05:00
backend-zig docs: 2026-06-10 09:14 CDT compile-loop wind-down — watchdog stopped, chrono 326/326, ef_list 169 2026-06-10 09:32:05 -05:00
cmd folksong: cut abandoned incremental-compilation + dead code (~3050 lines) 2026-06-11 23:08:36 -05:00
docs docs: lock string/slice returns to multi-value ABI (D11) 2026-07-09 16:56:55 -05:00
examples packaging: bump rdnk formula to 0.1.10; wasm_webgpu example restructure 2026-06-11 21:25:39 -05:00
frontend/src wasm_bind: triangle shader (Odin #code -> WGSL) + reserved-attribute check 2026-06-11 20:29:51 -05:00
hymnal wasm_bind: finish soft spots — export alloc and package budgets 2026-07-09 23:31:26 -05:00
metaprograms wasm_bind: finish soft spots — export alloc and package budgets 2026-07-09 23:31:26 -05:00
packaging packaging: bundle frontend:src in rdnk release (0.1.14) so compiler:* metaprograms run 2026-06-11 23:10:47 -05:00
scripts webidl: corpus hygiene and parse status for used IDL 2026-07-09 22:16:21 -05:00
spec Reframe spec: native is THE path, vm2 interp is optional 2026-05-19 18:54:19 -05:00
src folksong: cut abandoned incremental-compilation + dead code (~3050 lines) 2026-06-11 23:08:36 -05:00
src-llvm homebrew: ship LLVM-capable rdnk + mitigate compile_llvm re-entrancy SIGBUS 2026-06-11 13:41:43 -05:00
tests backend-cranelift: depend on compiler:ast, not frontend:src (decoupling step 1) 2026-06-09 23:45:14 -05:00
vendor backend-cranelift: CL2.27 — predeclare-side type coverage + poly spec walk 2026-05-28 18:48:29 -05:00
.gitignore packaging: Homebrew formula + release script for rdnk (self-contained) 2026-06-10 14:16:44 -05:00
.gitmodules backend-cranelift+folksong: CL2.19 — for-range over map/slice/[dynamic]/array/string/int-range + more (K,V) helpers 2026-05-28 15:26:55 -05:00
build.odin rdnk: script runner + odin-style build.odin with in-process cross builds 2026-06-09 21:56:20 -05:00
README.md backend: rename odin-gaud → backend-llvm + scaffold backend-cranelift 2026-05-27 18:28:43 -05:00

FolkSong

The compiler + runtime that ties Odin's pure-Odin toolchain together into a usable whole: checking, native codegen, interpretation, module packaging, caching, overrides, and compile-time metaprogramming.

FolkSong is the conductor. It owns no frontend of its own — it orchestrates a frontend and (currently) two pluggable backends, all in the same repo:

FolkSong  (this project — BarnYard, .chkn-coop, driver, intercepts)
├── frontend/          — odin-squared: the checker (typed AST + CheckerInfo)
├── backend-llvm/      — LLVM backend (AST → native) — production path
├── backend-cranelift/ — Cranelift backend (AST → native) — fast-iter, in development
└── ../odin-vm2/       — bytecode interpreter (AST → bytecode → run) — optional sibling repo

The name

A folk song is a tune that gets passed around — everyone plays their own rendition, but it's recognizably the same song. In FolkSong, the interpreter and the native backend are two renditions of the same checked AST: same tune, different players. See the FolkSong dual- backend execution model in spec/j0_design.md.

The theme runs through the architecture:

  • BarnYard — the top-level coordinator per compilation (where the session happens)
  • .chkn-coop — the compiled module file (where the chickens roost)
  • FolkSong — the dual-backend execution (the tune everyone plays)
  • Cuttin' heads — the oracle cross-check (interp vs native, head to head, outputs must match)

What FolkSong provides

  • BarnYard — per-compilation coordinator: module DAG, resolver + overrides, GOT-based linking, diagnostics, lifetimes
  • .chkn-coop — immutable, self-describing, mmap-friendly fat module files: full AST + LLVM bitcode + per-ISA native + DWARF + const pool + structural import/export tables
  • FolkSong dual-backend — native (LLVM backend) is THE execution path; Cranelift is the in-development fast-iteration backend; the vm2 interp is an optional dev/oracle backend rendering the same AST
  • Compiler intercepts — Jai-style metaprogram message loop; the main program drives the build by draining a message stream
  • Build system — recompile decisions (mtime-based in v1), distinct from the file format and the loader
  • Bootstrap — host → guest environment injection (argc/argv, @(init) procs, runtime startup)

What FolkSong does NOT own

  • The checker — odin-squared
  • Native codegen — backend-llvm (LLVM) and backend-cranelift (Cranelift, WIP)
  • The bytecode interpreter + bytecode format — odin-vm2
  • Runtime conventions (foreign bridge, host intrinsics) — currently odin-vm2; may be extracted to a shared module later

Status

Design phase. See docs/PLAN.md for the phased plan and docs/STATUS.md for current progress. The architecture is specified in spec/j0_design.md.

Naming history note: the LLVM backend was originally called odin-gaud in the design docs. It was renamed to backend-llvm when backend-cranelift joined as a second backend; older docs may still reference odin-gaud and mean the same component.

Layout

FolkSong/
├── README.md
├── docs/
│   ├── PLAN.md          # phased plan (J0 ... J10)
│   └── STATUS.md        # progress dashboard, updated each session
├── spec/
│   └── j0_design.md     # the architecture spec
├── src/                 # implementation (empty — J0 not started)
└── cmd/                 # driver entry points (empty)