btrc
C, but better. Built with AI in just a few weeknights
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
btrc is a statically-typed language that transpiles to C11. It adds classes, generics (monomorphized), type inference, lambdas, f-strings, collections (Vector, Map, Set), threads, GPU compute via WebGPU, ARC memory management, exception handling, and a standard library — while generating strict C11 with no runtime, no GC, and no VM.The compiler is a 6-stage Python pipeline (lexer → parser → analyzer → IR gen → optimizer → C emitter) driven by a formal EBNF grammar and an algebraic AST spec (Zephyr ASDL). The generated C is readable and linkable with any C11 compiler. It ships with a VS Code extension (LSP with completions, diagnostics, go-to-def, hover) and 930 tests.I've wanted to build something like this for about 10 years, but it was always too ambitious of a project to do on the side. With AI, I was able to build it over a handful of evenings after work, which is really wild.Some things worth noting:A few things that I find fun / interesting / noteworthy:- The EBNF grammar and ASDL spec are the single source of truth — the lexer, parser, and AST node classes are all derived from them, not hardcoded- Generics are monomorphized (like C++ templates / Rust), so zero runtime overhead but binary size grows per type combination- ARC handles most memory management including cycle detection and cleanup on exceptions — no GC, deterministic destruction- The entire stdlib (collections, math, datetime, IO, threading) is written in btrc itself- @gpu functions transpile to WGSL compute shaders with auto-generated WebGPU boilerplate — array params become storage buffers, scalars become uniforms- The generated C is meant to be readable — you can step through it in gdb/lldb and it mostly makes sense (just verbose with lots of underscores)- There's a 3D game engine example (ball + WASD + jump + shadows + raymarching) that's ~570 lines of btrc across 11 small modules- The VS Code extension reuses the compiler's own lexer, parser, and analyzer — diagnostics match exactly what the compiler reports- btrc inherits C's memory model wholesale — no borrow checker, no lifetime analysis. You can absolutely still shoot yourself in the foot- The whole thing was built in a few evenings after work with heavy AI assistance, which felt like the most interesting part of the project honestly
HN · launched Mar 2, 2026 · 5 upvotes (top 89%) · 0 views
Niche: programming languages and interpreters · 161 launches, 2 in the last 7 days ▼ -75% · Explore this niche →
Category and tags
- Horizontal
- Dev tools
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 161 launches in programming languages and interpreters →
Could you build this?
No Building a reliable, full-featured compiler/transpiler with generics, monomorphization, ARC memory management, WebGPU integration, and a custom standard library requires deep expertise in compiler architecture and programming language theory. While AI can scaffold simple parsers, maintaining rigorous semantic analysis, borrow/reference semantics, and bug-free code generation requires specialized systems engineering.
What it would actually take: A production transpiler requires a robust lexer/parser pipeline (likely in Rust, C++, or OCaml), an AST with strong semantic analysis and monomorphization passes, and custom code generation targeting C11. ARC necessitates careful compiler-injected retain/release semantics with cycle detection or weak references, alongside runtime libraries for collections and WebGPU bindings. Deep domain knowledge in compiler design, memory models, and formal language semantics is required.
Discussion
1 comment analyzed.
Competitors
Other products that read as similar to this one : 390 launches clear the similarity bar, closest 8 shown.
Attention rank: #356 of 391 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 124 days after the earliest competitor.
- A systems language with runtime reflection and no GC · hn · 2025-12-15 · 6 upvotes · similarity 0.52
- CJIT, a single-binary C compiler that can self host · hn · 2026-04-13 · 7 upvotes · similarity 0.51
- Full Python 3.15 Implemented in 25k LoC C11 · hn · 2026-10-28 · 9 upvotes · similarity 0.50
- Mach · hn · 2026-06-08 · 32 upvotes · similarity 0.47
- Axe · hn · 2025-11-24 · 16 upvotes · similarity 0.47
- SHDL · hn · 2026-01-28 · 48 upvotes · similarity 0.46
- Valk · hn · 2026-02-10 · 5 upvotes · similarity 0.45
- Genotype: language that compiles to idiomatic TS, Rust and Python · hn · 2026-09-08 · 9 upvotes · similarity 0.45
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.