Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in 700 lines

Hacker News (score: 47)
Found: December 26, 2025
ID: 2807

Description

Other
Show HN: Xcc700: Self-hosting mini C compiler for ESP32 (Xtensa) in 700 lines 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.

More from Hacker

Movycat – A terminal movie player written in Zig

Movycat – A terminal movie player written in Zig I saw Mario (the author) at Zigtoberfest in Munich last Saturday where he gave a presentation on a whole stack of related projects implemented in Zig: A graphics library for the terminal (movy), movycat (video playback in the terminal), zig64 &amp; zigreSID (emulators for Commodore 64&#x27;s CPU and sound chip), and a reimplementation of a C64 video game (which I don&#x27;t think he has published on GitHub yet). Anyway, I found his work incredible and thought he deserved some attention.<p>Update: Since writing this, Mario has uploaded the game, too: <a href="https:&#x2F;&#x2F;github.com&#x2F;M64GitHub&#x2F;1st-shot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;M64GitHub&#x2F;1st-shot</a> . I misunderstood, though: It doesn&#x27;t seem to be a port of an actual C64 game.

Stress test for parallel disk i/o using git and pnpm

Stress test for parallel disk i/o using git and pnpm

Show HN: Lightweight tool for managing Linux virtual machines

Show HN: Lightweight tool for managing Linux virtual machines hey guys. the other day i was migrating hosting providers and i just needed something not too heavy and convenient to spin up my backups for awhile and realised there is almost nothing out there. kimchi hasn&#x27;t been updated for years and cockpit is heavy. so here&#x27;s something i came up with in a couple hours because of a sudden urge, nothing fancy just basic creation with cloud init, lifecycle management and image&#x2F;storage, but it&#x27;s modern-ish and it compiles to a 8.4mb binary inclusive of the embedded web UI, CLI and API, and only dep is libvirt.

Brut: A New Web Framework for Ruby

Brut: A New Web Framework for Ruby

No other tools from this source yet.