Tilde, My LLVM Alternative
An experimental compiler backend called Tilde aims to be a smaller, faster alternative to LLVM, rekindling long‑running debates about compiler complexity, optimization strategies, and the feasibility of “starting over” on such a mature technology. Commenters compare Tilde with other lightweight backends and with MLIR, weigh trade‑offs in implementation languages (C vs modern C++ and others), and highlight how hard it is to match LLVM’s optimization quality without inheriting similar architectural and maintenance burdens. While many welcome new competition—especially for JIT, GC‑heavy, or resource‑constrained use cases—experienced compiler engineers caution that achieving LLVM‑class performance and flexibility will likely take many years and substantial collaborative effort.
Overall reaction
- Many commenters like seeing a new, smaller alternative to LLVM and hope competition will improve the ecosystem.
- Others are skeptical that a single new project can match LLVM/GCC’s optimization quality and breadth, especially in “a few years.”
Comparisons to existing backends
- Alternatives mentioned: QBE, MIR, PHP’s IR, EigenCompilerSuite, Cwerg, tinycc, various vendor compilers.
- Some prefer small backends (e.g., QBE, MIR, IR) for simplicity and compile speed, though they often lack optimizers or full ABI/ISA coverage.
- A few argue that instead of starting from scratch, contributing optimizers to existing smaller projects might be more realistic.
Performance & optimization debate
- LLVM is criticized as slow and bloated, especially due to many passes.
- Tilde’s author proposes fewer, combined passes to reduce cache churn and phase-ordering issues.
- An experienced compiler engineer strongly challenges this, arguing:
- Those passes exist because combining them while matching LLVM’s performance is very hard.
- Proven-complete global value numbering and similar algorithms are complex, often with poor worst-case complexity.
- Matching LLVM across real-world code would likely take many people and many years, not a single project in a short time.
- Some suggest demonstrating a faster mid-end by acting as a drop-in replacement for LLVM’s
optrather than building a full C toolchain first.
IR design, Sea-of-Nodes, and scheduling
- Tilde uses a Sea-of-Nodes IR. Discussion notes:
- Pros: integrated optimizations, potential for fewer passes.
- Cons: requires a scheduling pass; other projects have moved away due to scheduling cost.
- Suggestions appear to look at SSA-based register allocation and block-argument SSA forms as potential differentiators from LLVM’s “cruft.”
Language, portability, and bootstrapping
- Tilde is in C. Supporters cite:
- C’s ubiquity, easier bootstrapping, fewer dependencies, broad platform support.
- Others dislike C/C++, citing:
- Slow builds, mediocre tooling, poor error messages.
- Calls for Rust, D, Go, or other high-level languages are countered with concerns about dependencies and compile speed.
MLIR and multi-level compilation
- Extended discussion on MLIR:
- It’s a framework for multiple IR “dialects,” not a simple LLVM replacement.
- Some expect more LLVM optimizations/codegen to move into MLIR over time, but this is seen as a long-term, labor-intensive effort.
- Low-level codegen (register allocation, instruction selection) is considered especially hard to replicate.