LLVM for Solana — Compiler Infrastructure Layer

Write Anchor.
Deploy Pinocchio or Quasar.

Anvil parses Anchor programs into a framework-agnostic IR, then emits optimized Pinocchio or Quasar Rust with live CU analysis.

Open Workbench
79%
CU reduction vs Anchor
4
input modes supported
3
live emit targets
HOW IT WORKS
01
Provide Anchor
Paste raw source, select a GitHub repo, or upload local files. No refactoring required.
02
Generate IR
Our tree-sitter AST parser extracts accounts, constraints, and logic into a typed SolanaIR.
03
Target Emit
Transpile the IR into idiomatic Pinocchio, Quasar, or Native Rust with full multi-file support.
04
CU Analysis
Analyze accurate cost tables mapping your original Anchor operations to low-level syscalls.
COMPILER PLAYGROUND

Select a program, pick a target, compile.

The quick demo playground is wired to the live counter and vault fixtures. For full power — paste source, upload a file or folder, or point Anvil at a GitHub repo — use the Workbench →

Program
Target Framework
1
Load fixture
GET /demo/:name
2
Parse IR
Anchor → SolanaIR
3
Emit code
IR → Rust
4
Complete
Code ready
Click "Compile" to generate Pinocchio code
COMPUTE UNIT ANALYSIS

Counter — savings per instruction

INSTRUCTION
ANCHOR
PINOCCHIO
QUASAR
NATIVE
initialize
79% saved
82% saved
75% saved
520 CU
108 CU
95 CU
130 CU
increment
79% saved
81% saved
74% saved
290 CU
62 CU
55 CU
75 CU
decrement
79% saved
81% saved
74% saved
290 CU
62 CU
55 CU
75 CU
reset
79% saved
82% saved
74% saved
265 CU
55 CU
48 CU
68 CU
TOTAL
1365
CU total
287
CU total
79% saved
253
CU total
81% saved
348
CU total
75% saved
READINESS
Working today
Anchor IR parser (tree-sitter AST) — instructions, accounts, constraints, errors
Pinocchio, Quasar, and Native emitters with full multi-file output
4 live demo programs (Counter, Vault, Escrow, Staking)
Static CU analysis with per-instruction cost tables
GitHub repo ingestion — paste any public repo URL and compile
Local file + folder upload — pick your own .rs entry file
Express API with /parse, /emit, /demo routes
Workbench: paste source, upload file/folder, or clone a repo
Phase 2 roadmap
Production-grade CPI generation for SPL token flows
Account space auto-calculation from IR field definitions
CLI: `anvil compile program.rs --target pinocchio`
IDL import — parse Anchor IDL JSON as IR input
VS Code extension for inline CU previews
Deploy-ready output validation + Anchor test compatibility
Auto-generated test suites for emitted code