No description
  • Odin 94.1%
  • Zig 2.6%
  • Rust 2.1%
  • Shell 0.8%
  • JavaScript 0.3%
Find a file
Be Dangerous 571d0dc77a
Some checks failed
build / linux-x86_64 (push) Successful in 4m22s
build / macos-arm64 (push) Has been cancelled
folksong: cut abandoned incremental-compilation + dead code (~3050 lines)
The on-disk cache + DAG invalidation + state-reset machinery never did
incremental reuse (check_parsed_files isn't re-entrant), was gated off by
default, and only produced stale .build/ artifacts. Removed it entirely, plus
three genuinely-dead files and one superseded prototype subcommand.

Deleted (9 files):
- cache.odin, barnyard_file.odin, coop_iface.odin, coop_ast.odin (on-disk
  bundle cache + cross-package serialization)
- dag.odin (import DAG + cascade), state_reset.odin (dirty-pkg reset) —
  the FOLKSONG_DAG/FOLKSONG_TOUCH/FOLKSONG_RESET_TEST diagnostics
- macro.odin (stale duplicate of frontend/src/macro.odin), run_code.odin
  (Code dump/render — only the superseded `folksong --run-llvm-code`
  prototype used it), intercept.odin (Jai-style message loop, never wired)

barnyard.odin: barnyard_load_module now just parses every package fresh —
removed the cache_load / coop_attach_ast / DAG-diagnostic / cache_save blocks
(all env-gated, off by default). cmd/folksong: removed the obsolete
--run-llvm-code subcommand (superseded by cmd/insertcheck). docs/STATUS.md:
replaced the "Cache / incremental rebuild" section with a removal note.

Verified behavior-preserving: rdnk + cmd/folksong + cmd/runcheck build clean;
runcheck #run/#insert 5/5; rdnk runs maps/strings/printf (CUT sum=42). The
#run-via-rdnk error on one fixture is identical pre/post (pre-existing).
Safety-checked: nothing outside the deleted set referenced their symbols, and
nothing sets the FOLKSONG_* env vars.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 23:08:36 -05:00
.forgejo/workflows ci(linux): minimal apt.llvm.org install for LLVM 22 (avoid disk exhaustion) 2026-06-11 20:51:04 -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 folksong: cut abandoned incremental-compilation + dead code (~3050 lines) 2026-06-11 23:08:36 -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: omit default-valued dict fields so descriptors are platform-valid 2026-06-11 20:58:30 -05:00
metaprograms docs: wasm_webgpu build runs under the cranelift JIT (rdnk path) 2026-06-11 22:50:46 -05:00
packaging packaging: rdnk 0.1.13 vendor-included build (LEAN=0) + caveats 2026-06-11 23:02:53 -05:00
scripts cmd/odin: an odin-compatible CLI that hardens backend-llvm via the compiler API 2026-06-11 08:43:32 -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)