Hacker News new | ask | show | jobs
by dismalaf 126 days ago
That's why there's nothing that comes close to LLVM and MLIR, right?

If he's such a horrible engineer then we should have lots of LLVM replacements, right?

2 comments

QBE is a tiny project, but I think illustrates a better intermediate language design. https://c9x.me/compile/
Except performance isn't great and it covers far fewer platforms. It aims for 70% performance but the few benchmarks I've seen show more like 30-50% performance.

It's a cool project and I'd consider it for a toy language but it's far from an LLVM replacement.

Many compilers including my own uses C89
You'll still need a C compiler...
I never heard of hardware without one
Avoiding interacting with LLVM as a user doesn't mean you've created something equivalent to LLVM.

And if the C compiler you use is clang then you're still literally making use of LLVM.

I don't know what point you're trying to make but your question was what's an alternative to llvm. People writing compilers always used C89 or a version of it (C11 allows an easier atomic implementation). There's a lot more C89 compilers than backends that llvm supports. When I was writing arduino code clang/llvm couldn't generate the AVR code for the board. The default toolchain was gcc with an AVR backend. IIRC it had optimizations and was the only reasonable compiler I could use. There's nothing wrong using C as your backend
> There's nothing wrong using C as your backend

I didn't say there was. Saying use C instead of LLVM is fine for a language designer.

But that doesn't make it a replacement for LLVM as a piece of infrastructure. C compilers still need an optimizing backend like LLVM.

The conversation is about whether or not LLVM is a shit piece of engineering, not whether you should target C or IR as a language designer. Avoiding using LLVM directly isn't a replacement lol.

You could say "GCC" is a replacement which at least isn't completely false, but GCC's backend is far more annoying to use for different languages.

IIRC, the Inmos Transputer shipped without a C compiler, and while third party products (including a port of GCC) did come later, it was Occam-only for quite some time.
So what you're saying is that C source code is the (only) stable LLVM ABI ;)
Haha, yes