Stream: compiler development

Topic: Cranelift/QBE/etc


view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:25):

A comment on the youtube video of richard's newest talk got me thinking...

Starting comment was:

> Wants a fast compiler
> Uses LLVM

I added some clarification in a reply and then they asked about QBE.
QBE seems quite promising in general to me. It "aims to provide 70% of the performance of industrial optimizing compilers in 10% of the code."

This raised the general question for me, should languages have 3 compiler backends in the current ecosystem?

The backends would be:

  1. Dev -> Tailored for the specific language and stunningly fast to compile. Hopefully, just good enough perf that the output is usable (though a tiny bit more perf can be nice at times). Assuming something like QBE is a thin enough layer (and thus has fast compile times), it's dev builds could potentially fill this niche for many languages. But that is a big assumption.
  2. Optimized -> Cranelift/QBE/Tilde Backend. Get 70% to 90% of the performance in significantly less time.
  3. Really Optimized -> LLVM to get to 95+% of the performance.

Note, you could add a 4 here as well, LLVM + LTO + PGO + any other tools.

view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:28):

And maybe this grouping isn't the right tradeoff, but I know plenty of projects where I can use dev cause the runtime is too slow, but I also hate waiting for the compile time of llvm.

view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:28):

I guess you could say that projects like go only have the equivalent of 2 and are quite successful.

view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:29):

I think D is in a similar boat.

view this post on Zulip Brendan Hansknecht (Apr 01 2024 at 18:30):

The big difference being they home built their own optimized but not crazily solution instead of using something like QBE or cranelift.


Last updated: Jul 06 2025 at 12:14 UTC