frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

SectorC: A C Compiler in 512 bytes

https://xorvoid.com/sectorc.html
147•valyala•5h ago

Comments

riedel•3h ago
Beautiful, but make sure to quickly add 2023 to the title.

Discussed at the time: https://news.ycombinator.com/item?id=36064971

sanufar•2h ago
The way hashing is used for tokens and for making a pseudo symbol table is such an elegant idea.
fix4fun•2h ago
I think the same. Really nice project and good trick with hashing tokens.

PS. There left 21 bytes (21 * 0x00 - from 0x01e0 to 0x01fd). Maybe something can be packed there ;)

xorvoid•2h ago
I may be the author.. enjoy! It was an absolute blast making this!
veltas•2h ago
This is very nice. I'm currently writing a minimalist C compiler although my goal isn't fitting in a boot sector, it's more targeted at 8-bit systems with a lot more room than that.

This is a great demonstration of how simple the bare bones of C are, which I think is one reason I and many others find it so appealing despite how Spartan it is. C really evolved from B which was a demake of Fortran, if Ken Thompson is to be trusted.

JamesTRexx•2h ago
Would and how much would it shrink when if, while, and for were replaced by the simple goto routine? (after all, in assembly there is only jmp and no other fancy jump instruction (I assume) ).

And PS, it's "chose your own adventure". :-) I love minimalism.

SAI_Peregrinus•1h ago
What fancy jumps are present in assembly depends on the CPU architecture. But there are always conditional jumps, like JNZ that jumps if the Zero flag isn't set.
einpoklum•2h ago
An interesting use case - for the compiler as-is or for the essentiall idea of barely-C - might be in bootstrapping chains, i.e. starting from tiny platform-specific binaries one could verify the disassembly of, and gradually building more complex tools, interpreters, and compiler, so that eventually you get to something like a version of GCC and can then build an entire OS distribution.

Examples:

https://github.com/cosinusoidally/mishmashvm/

and https://github.com/cosinusoidally/tcc_bootstrap_alt/

teo_zero•2h ago
It would be interesting to understand what non-toy programs can be coded in this subset of C. For example, could tcc be rewritten in this dialect?
tekknolagi•48m ago
You may enjoy https://github.com/ludocode/onramp
NooneAtAll3•2h ago
> I wrote a fairly straight-forward and minimalist lexer and it took >150 lines of C code

was it supposed to be "<150"?

owalt•2h ago
They're saying the naive implementation was more than 150 lines of C code (300-450 bytes), i.e. too big.
mojuba•2h ago
Compare that to the C compiler in 100,000 lines written by Claude in two weeks for $20,000 (I think was posted on HN just yesterday)
vidarh•1h ago
It's a fun comparison, but with the notable difference that that one can compile the Linux kernel and generate code for multiple different architectures, while this one can only compile a small proportion of valid C. It's a great project, but it's not so much a C compiler, as a compiler for a subset of C that allows all programs this compiler can compile to also be compiled by an actual C compiler, but not vice versa.
d_silin•53m ago
But can it compile "Hello, World" example from its own README.md?

https://github.com/anthropics/claudes-c-compiler/issues/1

Retr0id•45m ago
It's fascinating how few people read past the issue title
vidarh•44m ago
Noticed the part where all it requires is to actually have the headers in the right location?
d_silin•41m ago
"The location of Standard C headers do not need to be supplied to a conformant compiler."

From https://news.ycombinator.com/item?id=46920922 discussion.

vidarh•25m ago
And it doesn't for the compiler in question either. As long as the headers exist in the places it looks for them. No compiler magically knows where the headers are if you haven't placed them in the right location
mati365•2h ago
Oh, it looks like my X86-16 boot sector C compiler that I made recently [1]. Writing boot sector games has a nostalgic magic to it, when programming was actually fun and showed off your skills. It's a shame that the AI era has terribly devalued these projects.

[1] https://github.com/Mati365/ts-c-compiler

SeanSullivan86•1h ago
Why is it called a C Compiler if it's a subset of C?
gonzus•1h ago
Lacking support for structs, I think this is too minimalistic to be called "a C compiler".
kayo_20211030•1h ago
Nice. Very K&R-ish. Not a bad thing.

Tiny C Compiler

https://bellard.org/tcc/
45•guerrilla•1h ago•13 comments

You Are Here

https://brooker.co.za/blog/2026/02/07/you-are-here.html
26•mltvc•1h ago•19 comments

SectorC: A C Compiler in 512 bytes

https://xorvoid.com/sectorc.html
148•valyala•5h ago•23 comments

The F Word

http://muratbuffalo.blogspot.com/2026/02/friction.html
73•zdw•3d ago•28 comments

Brookhaven Lab's RHIC concludes 25-year run with final collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
35•gnufx•4h ago•38 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
76•surprisetalk•5h ago•87 comments

LLMs as the new high level language

https://federicopereiro.com/llm-high/
15•swah•4d ago•7 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
116•mellosouls•8h ago•223 comments

GitBlack: Tracing America's Foundation

https://gitblack.vercel.app/
8•martialg•35m ago•1 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
156•AlexeyBrin•10h ago•28 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
864•klaussilveira•1d ago•263 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
112•vinhnx•8h ago•14 comments

FDA intends to take action against non-FDA-approved GLP-1 drugs

https://www.fda.gov/news-events/press-announcements/fda-intends-take-action-against-non-fda-appro...
26•randycupertino•43m ago•19 comments

Show HN: A luma dependent chroma compression algorithm (image compression)

https://www.bitsnbites.eu/a-spatial-domain-variable-block-size-luma-dependent-chroma-compression-...
20•mbitsnbites•3d ago•1 comments

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
72•thelok•7h ago•13 comments

First Proof

https://arxiv.org/abs/2602.05192
73•samasblack•7h ago•57 comments

Italy Railways Sabotaged

https://www.bbc.co.uk/news/articles/czr4rx04xjpo
61•vedantnair•1h ago•42 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
252•jesperordrup•15h ago•82 comments

I write games in C (yes, C) (2016)

https://jonathanwhiting.com/writing/blog/games_in_c/
155•valyala•5h ago•134 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
528•theblazehen•3d ago•196 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
37•momciloo•5h ago•5 comments

Selection rather than prediction

https://voratiq.com/blog/selection-rather-than-prediction/
18•languid-photic•3d ago•5 comments

Reinforcement Learning from Human Feedback

https://rlhfbook.com/
97•onurkanbkrc•10h ago•5 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
209•1vuio0pswjnm7•11h ago•314 comments

72M Points of Interest

https://tech.marksblogg.com/overture-places-pois.html
42•marklit•5d ago•6 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
52•rbanffy•4d ago•13 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
129•videotopia•4d ago•40 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
269•alainrk•10h ago•448 comments

France's homegrown open source online office suite

https://github.com/suitenumerique
642•nar001•9h ago•281 comments

Microsoft account bugs locked me out of Notepad – Are thin clients ruining PCs?

https://www.windowscentral.com/microsoft/windows-11/windows-locked-me-out-of-notepad-is-the-thin-...
47•josephcsible•3h ago•66 comments