btrc
C, but better. Built with AI in just a few weeknights
Details
- External ID
- 47221459
- Source
- HN
- Company
- —
- Product
- btrc
- Website domain
- github.com
- Launched
- March 2, 2026
- Cohort
- —
- Upvotes
- 5
- Upvotes percentile
- 0.1070110701107011
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
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
Enrichment
- Theme
- Claude integrations and coding agents
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- AI feature
- Project type
- Hobby / open-source project
- Normalized one-liner
- c programming language reimplemented with ai
- Manually corrected
- False
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 — 201 launches clear the similarity bar, closest 8 shown.
Attention rank: #187 of 202 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 119 days after the earliest competitor.
- A systems language with runtime reflection and no GC · hn · 2025-12-15 · 6 upvotes · similarity 0.50
- CJIT, a single-binary C compiler that can self host · hn · 2026-04-13 · 7 upvotes · similarity 0.50
- Mach · hn · 2026-06-08 · 32 upvotes · similarity 0.45
- Axe · hn · 2025-11-24 · 16 upvotes · similarity 0.45
- SHDL · hn · 2026-01-28 · 48 upvotes · similarity 0.44
- Valk · hn · 2026-02-10 · 5 upvotes · similarity 0.43
- Forge-GPU · hn · 2026-02-27 · 5 upvotes · similarity 0.43
- Micron: a high performance C++23 (re)implementation of Libc and the STL · hn · 2026-06-05 · 6 upvotes · similarity 0.43
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.