How I Wrote a Svelte Compiler in Rust
Anthropic
OpenAI
A frontend developer shares his journey of writing a Svelte compiler in Rust, first manually for five and a half months, then with heavy AI assistance over several months. He details his struggles with Rust lifetimes, the evolution of his approach, and the massive productivity gains from using Claude and Codex.
Konstantin, a frontend developer at an enterprise company, decided to write a Svelte compiler in Rust due to slow build times, laggy LSP, and slow svelte-check in their large codebase. He started on November 4, 2024, and after 5.5 months and 303 commits, he abandoned the project on April 24, 2025, stuck on Rust's borrow checker and lifetime issues. In March 2026, he returned, leveraging AI tools like Claude and Codex for 'AI generation'. He restructured the AST to store spans instead of string references, simplifying the code. He used AI agents extensively, burning through subscriptions but completing the work at a fraction of the API cost. He encountered various challenges: testing by comparing outputs with the original compiler, normalizing CSS, and managing many AI sessions. Despite some false positives from review agents, the AI-driven approach proved highly productive, achieving in months what would have taken much longer manually.
- Сокращения
- LSP = Language Server Protocol — Протокол языкового сервера
- AST = Abstract Syntax Tree — Абстрактное синтаксическое дерево
- HIR = High-level Intermediate Representation — Высокоуровневое промежуточное представление
- IDE = Integrated Development Environment — Интегрированная среда разработки
- API = Application Programming Interface — Программный интерфейс приложения
Source: Habr — хаб ИИ —
original
