Live data from Hacker News

Aro – Zig's new C compiler

github.com

1–10 of 130 posts

Re: Aro – Zig's new C compiler

#2
It would be interesting to see how well it optimizes compared to the established players. The fact that it handles C23 and common GNU extensions is already impressive.

Re: Aro – Zig's new C compiler

#5
post #2

It would be interesting to see how well it optimizes compared to the established players. The fact that it handles C23 and common GNU extensions is already impressive.

I agree it does seem very impressive. My first thought was that they must be using LLVM for the backend, but it looks like no, it's fully 'self-contained'.

Re: Aro – Zig's new C compiler

#7

There's doesn't appear to a whole lot of comments or documentation in the code. Is this normal for Zig projects? Does it have an equivalent of Sphinx to build docs from code?

Zig has a documentation generator that uses specially formatted comments, similar to godoc or JSDoc.

Re: Aro – Zig's new C compiler

#8
I'm not all that familiar with the Zig tool chain.

Am I understanding correctly that this is a regular C compiler used as a component of the Zig compiler chain allowing compilation of C files alongside Zig? Or does Zig generate C and therefore need a C compiler under the hood?

Looking at the documentation suggests it is the former, not the latter.

Re: Aro – Zig's new C compiler

#10
The dlang D compiler includes a full C compiler, so you can mix and match C and D code. You can import C code from D, and D code from C.

    dmd hello.c
    ./hello
    hello world
This helps enormously in binding to existing C libraries.
Post reply on HN