Portable self-hosted codegen library
Find a file
2026-08-26 21:35:21 -07:00
.github/workflows chore: init ci 2026-08-24 14:08:03 -07:00
frontends fix: nix store search, aarch64-darwin callconv 2026-08-24 14:08:03 -07:00
libs fix(x86_64): call_indirect 2026-08-26 21:35:21 -07:00
pkgs feat: vcc in nix 2026-08-23 12:04:53 -07:00
test feat(vcc): init 2026-08-23 12:04:53 -07:00
tools feat(vcc): add f128 2026-08-24 14:08:03 -07:00
.envrc feat: init 2026-06-21 22:45:51 -07:00
.gitignore refactor: disasm, c/js emit, improvements 2026-07-06 21:15:39 -07:00
build.zig feat(vcc): optimizations 2026-08-23 12:04:53 -07:00
build.zig.zon feat: init 2026-06-21 22:45:51 -07:00
flake.lock feat: init 2026-06-21 22:45:51 -07:00
flake.nix chore(flake): add aarch64-darwin 2026-08-24 14:08:03 -07:00
LICENSE Initial commit 2026-06-04 11:42:41 -07:00
README.md feat: init 2026-06-21 22:45:51 -07:00

Vulcan

Portable, self-hosted code generation. Vulcan lowers a small SSA IR to native machine code for several targets, with no LLVM dependency: its own register allocators, linker, and JIT.

Targets

  • AArch64 (A64 + NEON): native JIT, ELF objects, linker, runnable ELF executables
  • RISC-V (RV64 + RVV): ELF objects, linker, JIT
  • x86-64 (SSE/SSE2 + AVX) and x86-32: ELF objects, linker, JIT
  • NVIDIA SASS (compute and graphics): encoder and instruction selection
  • Container formats: in-memory W^X JIT, ELF objects and executables, baremetal flat binaries, UEFI PE32+/COFF

Frontends

  • WebAssembly (vulcan-wasm): Wasm to IR to JIT, as a host CLI or a UEFI boot application
  • GLSL (vulcan-glsl): a GLSL to SPIR-V shader compiler
  • SPIR-V (vulcan-spirv): bidirectional SPIR-V and IR

Optimization (vulcan-opt)

A pass manager with cached analyses (dominators, CFG, natural loops) driving constant folding, GVN/CSE, LICM, DCE, inter-procedural inlining, SLP auto-vectorization, and division lowering, plus link-time optimization (LTO) and profile-guided optimization (PGO).

Build

zig build                        # host CLIs: vulcan-wasm, vulcan-glsl
zig build test                   # run the test suite
zig build run-glsl  -- in.glsl   # compile GLSL to SPIR-V
zig build run-wasm  -- in.wasm   # JIT and run a Wasm module
zig build -Dtarget=x86_64-uefi   # build the UEFI boot application

Requires Zig 0.16. The Nix flake provides a dev shell with the toolchain (nix develop).