smlckz boosted
smlckz boosted
smlckz boosted

I took some time today to learn QBE syntax. It's basically a tiny LLVM:

Wrote my standard Brainfuck compiler in QBE IR:

Works on #OpenBSD, so it works for me.

I'm thinking the PL/0 compiler could adopt QBE as its backend. That would satisfy the "compile to assembly" thing I want to do, plus it'll provide amd64 and arm64 (and eventually riscv64) assembly output and quality optimizations. And it's far easier to write QBE IR than LLVM IR.

smlckz boosted

A new #blog post appears!

We're beginning a new series, "Let's write a compiler." In part 1, we'll introduce what a compiler is, select a language for our compiler, and do some high-level (no code) planning.

At the end of the series, you will have written a complete compiler from scratch! It won't be the world's fanciest compiler, but it will be correct. And it will be fast! Good for beginners.

#coding #code #program #programming #compiler #compile #compilers

smlckz boosted

My profile picture now generated from pic instead of being hand drawn.



C.IM is a general, mainly English-speaking Mastodon instance.