Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in 700 lines
Details
- External ID
- 46392736
- Source
- HN
- Company
- —
- Product
- Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in 700 lines
- Website domain
- github.com
- Launched
- Dec. 26, 2025
- Cohort
- —
- Upvotes
- 154
- Upvotes percentile
- 0.9303435114503816
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:25 p.m.
- Updated at
- Sept. 7, 2026, 9:25 p.m.
Description
Repo: https://github.com/valdanylchuk/xcc700Hi Everyone! I just wrote my first compiler!- single pass, recursive descent, direct emission- generates REL ELF binaries, runnable using ESP-IDF elf_loader- very basic features only, just enough for self-hosting- treats the Xtensa CPU as a stack machine for simplicity, no register allocation / window usage- compilable on Mac, probably also Linux, can cross-compile for esp32 there- wrote for fun / cyberdeck projectSample output from esp32: xcc700.elf xcc700.c -o /d/cc.elf [ xcc700 ] BUILD COMPLETED > OK > IN : 700 Lines / 7977 Tokens > SYM : 69 Funcs / 91 Globals > REL : 152 Literals / 1027 Patches > MEM : 1041 B .rodata / 17120 B .bss > OUT : 27735 B .text / 33300 B ELF [ 40 ms ] >> 17500 Lines/sec << My best hope is that some fork might grow into a unique nice language tailored to the esp32 platform. I think it is underrated in userland hobby projects.
Enrichment
- Theme
- lightweight and on-device AI runtimes
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- c compiler for esp32 in 700 lines
- Manually corrected
- False
Could you build this?
No Writing a self-hosting C compiler targeting the proprietary Xtensa architecture and emitting valid relocatable ELF binaries requires deep expertise in systems architecture and ABI specifications.
What it would actually take: Requires implementing a recursive descent parser, register allocator, and machine code emitter conforming directly to the Tensilica Xtensa instruction set and ESP-IDF calling conventions. The extreme challenge lies in achieving true self-hosting within tight line constraints while correctly generating low-level ELF object headers and relocations. Needs specialized expertise in compiler backends and embedded microcontroller architectures.
Discussion
20 comments analyzed.
Competitors mentioned: Go, Rust (borrow checker), C++, Managed languages, Zephyr RTOS
Concerns raised: C security exploits in standard library (strings, arrays) remain unfixed since 1979, WG14 lacks interest in security improvements despite charter goals, Compiler vendors underfunded and not sufficiently engaged in ISO efforts, ISO standardization process unable to achieve stated security goals, Moving away from C toward more complexity harms IT security and sovereignty
Feature requests: C language with borrow checker and Result/Option types, Improve expression evaluation precision in C standard, Better side-effect representation in AST for initializers, Execute-in-place (XIP) support preservation when loading ELFs
Competitors
Other products that read as similar to this one — 219 launches clear the similarity bar, closest 8 shown.
Attention rank: #18 of 220 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 56 days after the earliest competitor.
- CJIT, a single-binary C compiler that can self host · hn · 2026-04-13 · 7 upvotes · similarity 0.62
- A (marginally) useful x86-64 ELF executable in 298 bytes · hn · 2026-04-07 · 13 upvotes · similarity 0.53
- A (marginally) useful x86-64 ELF executable in 301 bytes · hn · 2026-04-06 · 65 upvotes · similarity 0.51
- Cj–tiny no-deps JIT in C for x86-64 and ARM64 · hn · 2025-11-05 · 21 upvotes · similarity 0.51
- Instant-on tiny ESP32 PC with an editor, compiler, and apps installer · hn · 2026-01-29 · 7 upvotes · similarity 0.50
- Zero deps C++ ASR binary for Linux (0MB idle RAM, no daemons, Unix way) · hn · 2026-06-04 · 5 upvotes · similarity 0.47
- Lamina · hn · 2025-11-20 · 5 upvotes · similarity 0.46
- Micron: a high performance C++23 (re)implementation of Libc and the STL · hn · 2026-06-05 · 6 upvotes · similarity 0.45
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.