# Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in…

Repo: https://github.com/valdanylchuk/xcc700 Hi 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 mac…

- **Page:** https://magpie.gallery/i/xcc700-self-hosting-mini-c-compiler-for-esp32-xten-ymv0
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Runs on:** macos, linux
- **Tags:** compiler, esp32, xtensa, c, self-hosting

## Source

Web · isitcontent: Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in 700 lines

- **Original:** https://news.ycombinator.com/item?id=46392736

> Repo: https://github.com/valdanylchuk/xcc700 Hi 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 project Sample 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. https://github.com/valdanylchuk/xcc700

## GitHub projects

- https://github.com/valdanylchuk/xcc700

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
