QBE – Compiler Back End

smartmic 88 points 24 comments May 08, 2026
c9x.me · View on Hacker News

Discussion Highlights (9 comments)

superdisk

Cool project, and FWIW it's like one Claude prompt to add MIPS support to this. I did that and then was able to compile my little custom language to the N64.

graemeg

Do you know if there is ongoing work to support x86_64 on Windows?

lucrbvi

I really like QBE but I hope they will make it a true library because I don't want to launch a subprocess to compile a program.

Tiberium

Also relevant: https://git.sr.ht/~mcf/cproc is a C compiler on top of QBE

anthk

A, c9x among codemadness, cool people, among gopher://bitreich.org https://codemadness.org/git/ Tons of these tools I use are from these guys (among 2f30). Small, predictable, usable, such as pointtools and catpoint. Sfeed for RSS, scc for gopher and so on, and smu for markdown from git repos > html.

sylware

Combined with cproc, I get 70% of gcc -O2, for a small fraction of the code... and a plain and simple C coded compiler.

cestith

Related, there’s Blaise which is a new Object Pascal that uses QBE as its backend. https://news.ycombinator.com/item?id=48058644 There’s also cproc which has a few HN posts about it. https://news.ycombinator.com/item?id=24076603 https://news.ycombinator.com/item?id=28242024 https://news.ycombinator.com/item?id=32466098 https://news.ycombinator.com/item?id=25273918

fweimer

IR description here: https://c9x.me/git/qbe.git/tree/doc/il.txt It looks like it doesn't have native support for identifying GC roots, so it's either conservative GC or explicit stack management. I would really like to see something that is (mostly) memory-safe and has string-as-bytes. It's a bit wild that people use Chez Scheme as a target IR for lack of better options.

stevefolta

Looks like a new 1.3 release is coming very soon. I love QBE, but it does have its limitations: - It handles the ABIs for passing and returning structures in registers, but only with superfluous copies to and from the stack. - Can't generate debug info for data. This is probably due to lack of assembler support and/or complexity in the DWARF format. - The line number debug info directives are currently undocumented and don't support inlined functions. But it's smol, effective, and it doesn't make you deal with phi nodes!

Semantic search powered by Rivestack pgvector
8,303 stories · 78,303 chunks indexed