Portable self-hosted codegen library
  • Zig 99.8%
  • C 0.2%
Find a file
2026-11-26 01:34:25 -08:00
.github/workflows feat: link generated code on arm64 darwin 2026-11-04 22:24:59 -08:00
bench fix: formatting 2026-11-04 21:49:02 -08:00
examples feat: init netlists 2026-11-08 21:43:35 -08:00
frontends feat(vulcan-forth): add a forth frontend 2026-11-26 01:34:25 -08:00
libs feat(vulcan-forth): add a forth frontend 2026-11-26 01:34:25 -08:00
pkgs chore: add tcc to the benchmark suite 2026-11-04 21:49:01 -08:00
test
tools feat: link generated code on arm64 darwin 2026-11-04 22:24:59 -08:00
.envrc
.gitignore
build.zig feat(vulcan-forth): add a forth frontend 2026-11-26 01:34:25 -08:00
build.zig.zon
flake.lock
flake.nix feat: add cuda benchmark suite 2026-10-31 14:44:45 -07:00
LICENSE
README.md feat: init netlists 2026-11-08 21:43:35 -08: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
  • Netlists: categorical theory on IR to yosys netlists
  • 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
  • IR compiler (vulcan-irc): compile Vulcan IR to target-specific outputs

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                        # also installs vulcan-irc

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).