Live data from Hacker News

Aro – Zig's new C compiler

github.com

61–70 of 130 posts

Re: Aro – Zig's new C compiler

#61
post #47
post #46

Earlier quoted context omitted.

It doesn't relate to Zig at all, but Walter Bright is the creator of D and tremendously proud of it.

I know that he is but this is incredibly off-topic. Aro deserves the attention it is getting, without the discussion getting hijacked by another project. D would deserve attention too, in a separate post, or here if it was explained how it relates to Aro.

His post does seem self-promotional I admit but Walter usually shows up in any threads about compilers and usually shares interesting comparisons and contrasts to how his language and compiler handled the issue.

For me, I appreciate the perspective and opinions of someone else in the industry with proven results. D is a major language, you can't deny that.

Maybe this post he should have went into a little more detail but I do not think he posted this with ill intent.

If anything I'm sure he would love to continue a dialog about the design decisions that led him to implement the same feature - and maybe this was his way of starting the conversation.

Given that he is a 15 year member of our community, and has earned 70k karma, we should give him the benefit of the doubt.

Re: Aro – Zig's new C compiler

#62

I don't think it's accurate to call it "Zig's". This is an independent project started by Veikka Tuominen, a Zig core team member, but it's not owned or managed by ZSF in any way. It's Veikka's project. Don't take that away from him!

Is it intended/desired for Zig to use it in lieu of libclang at some point?

Re: Aro – Zig's new C compiler

#63
post #43

Earlier quoted context omitted.

It’s constraints on memory management basically will never allow that to happen. It lures people in with “use any allocator you want”! Which only appears as freedom of choice when reality it’s locking the user into the same paradigm of memory management that has given C a bad name to begin with.

1/3 of the problem with c memory management is null unsafely, not a problem in zig. 1/3 more is conflating arrays with single item pointers. Also not a problem with zig. The only memory management "issue" with zig is lack of temporal memory safety.

[dead]

Re: Aro – Zig's new C compiler

#64

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.

Interesting, good to know.

Re: Aro – Zig's new C compiler

#65
post #29

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.

How exactly does this relate to the post, Aro, other than this also being a C compiler? Could you draw a comparison for those who came here for Zig and not D? What conclusion should we draw about Aro based on what you’re saying?

Jeez!

The post title is "Aro, Zig's new C compiler", not just about Aro or Zig. In fact, just by virtue of being about Aro, it is also about C compilers - as the title clearly says, whether you (pedantically) like it or not. And D is a language that is used as a better C too, apart from other things. In fact, lang C -> lang D, says something significant to this discussion, right?

>Could you draw a comparison for those who came here for Zig and not D?

Sigh.

More pedantic talk.

Shall we start drawing Venn diagrams to clarify things?

Is it not possible that there can be different groups of people, some of whom are interested in Zig, others in Zig and Aro, others in C compilers generally, and others in D with some of those groups overlapping? That's what Venn diagrams are meant to show.

Re: Aro – Zig's new C compiler

#66
post #47
post #46

Earlier quoted context omitted.

It doesn't relate to Zig at all, but Walter Bright is the creator of D and tremendously proud of it.

I know that he is but this is incredibly off-topic. Aro deserves the attention it is getting, without the discussion getting hijacked by another project. D would deserve attention too, in a separate post, or here if it was explained how it relates to Aro.

>I know that he is but this is incredibly off-topic.

no, it is not. in the fine tradition of hn, let me reply by saying, "that's like, just your opinion, man". which is not worth more than any other people's opinion on this site. maybe worth less.

e.g.:

>D would deserve attention too if ...

so now you are telling everyone what deserves attention?

then what have you done to deserve attention yourself (to your comments, that is)?

walter has done plenty. he created the D language, and still maintains it, along with others, like, you know, Andrei, for one. Google who that is.

Google about Walter to know what other stuff he has done before, like you know, the Zortech C++ compiler.

Re: Aro – Zig's new C compiler

#67
post #58
post #53

Earlier quoted context omitted.

System header search paths are only implemented on Linux currently. You should be able to parse sqlite3.c on Linux with arocc -fsyntax-only -Wno-unknown-attributes sqlite3.c

I'm primarily interested in full compilation performance, but thanks for the tip!

Very little of the backend appears to be implemented currently.

Re: Aro – Zig's new C compiler

#68

Earlier quoted context omitted.

The language itself is the reason the tooling exists though, because it attracts a certain kind of developer that probably would not have done the same kind of work for other languages.

what kind of developer is that? interested to know. I have a lot of prior C usage background, including for nontrivial stuff, including a product, although it has been a while since I used it. and I am checking out zig as one of my next languages to learn in the C-like / systems programming area.

I think it is logistics, infrastructure oriented vs language feature oriented. Looking at current PL landscape Go, Zig appears to be infrastructure oriented languages where features are just enough to keep infrastructure super fast. Whereas most other languages like Rust, Kotlin and so many more feature oriented if compiler gets fast, runtimes get better its nice but they'd rather work on long list of modern language features.

To be honest PL market feels similar to consumer market where gadgets with myriad smart features sell more than plain but solid machines.

Re: Aro – Zig's new C compiler

#69
post #30

Earlier quoted context omitted.

The grandparent post refers to the fact that Zig ships with C, C++ library source that it lazily cross-builds (at least for linux, I don't recall how it solves this problem for macOS or windows). And possibly it uses lld too? Since Zig ships with these, it makes the whole cross-build experience much smoother and less dependent on whether your host OS distribution includes packages for your desired target OS/architect…

Exactly. Zig tooling includes a linker, and that's also cross-platform. Zig can generate actual runnable executables that run anywhere from a single machine. As far as I can tell, D's DMD can cross compile but not link. I probably missed that before (actually, I think I was trying with LDC, I found the page where they document the process while searching for it just now: https://wiki.dlang.org/Cross-compiling_with_LD…

A cross-linker would be required for that to work. If you use a cross-linker with D, it should work.

Re: Aro – Zig's new C compiler

#70

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.

I would 100% be a D user if it had full C++ typesystem fluency.

D has a lot of compatibility with C++'s type system. But not with everything - for example, D does not have a `volatile` type. What is missing that you're interested in?
Post reply on HN