Live data from Hacker News

Aro – Zig's new C compiler

github.com

71–80 of 130 posts

Re: Aro – Zig's new C compiler

#71
post #47

Earlier quoted context omitted.

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…

[deleted]

Re: Aro – Zig's new C compiler

#72
post #47

Earlier quoted context omitted.

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…

Let me just say, your comments have not been the most constructive I’ve read.

Re: Aro – Zig's new C compiler

#73
One of the features missing in bun:ffi is inferring types for symbols from header files. This would let you import C libraries in JavaScript/TypeScript directly, without having to configure bindings.

We embed TinyCC for FFI, but TinyCC doesn't expose a way to read the types for exported symbols.

Currently, it looks like this:

      import { dlopen, FFIType, suffix } from "bun:ffi";

      // `suffix` is either "dylib", "so", or "dll" depending on the platform
      // you don't have to use "suffix", it's just there for convenience
      const path = `libsqlite3.${suffix}`;

      const {
        symbols: {
          sqlite3_libversion, // the function to call
        },
      } = dlopen(
        path, // a library name or file path
        {
          sqlite3_libversion: {
            // no arguments, returns a string
            args: [],
            returns: FFIType.cstring,
          },
        },
      );
      console.log(`SQLite 3 version: ${sqlite3_libversion()}`);
It would be nicer if it was something like this:

      import {sqlite3_libversion as version} from "sqlite3.h" with {lib: "sqlite3"};
      console.log(`SQLite 3 version: ${version()}`);

Would love to use Aro to do this in the future

Re: Aro – Zig's new C compiler

#74

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 was about to say this, and DMD compiles C code insanely FAST!

Re: Aro – Zig's new C compiler

#75
post #61
post #47

Earlier quoted context omitted.

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…

> he should have went into a little more detail

If there's interest, I can give more detail.

Re: Aro – Zig's new C compiler

#76
post #72

Earlier quoted context omitted.

>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…

Let me just say, your comments have not been the most constructive I’ve read.

Sure, I will let you say it :)

Let me say that I think the same about this comment of yours upthread:

>>D would deserve attention too, in a separate post, or here if it was explained how it relates to Aro.

In case you cannot or don't want to google for some reason, here are the Wikipedia articles about D, Walter and Andrei, and important related topics (all on Wikipedia, which implies notability) that I suggested you look up, above:

https://en.m.wikipedia.org/wiki/Walter_Bright

https://en.m.wikipedia.org/wiki/Zortech_C%2B%2B

https://en.m.wikipedia.org/wiki/Empire_(1977_video_game)

https://en.m.wikipedia.org/wiki/D_(programming_language)

https://en.m.wikipedia.org/wiki/Andrei_Alexandrescu

https://en.m.wikipedia.org/wiki/Modern_C%2B%2B_Design

https://en.m.wikipedia.org/wiki/C%2B%2B

Edit: spelling

Re: Aro – Zig's new C compiler

#77

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?

Yes. In fact, Aro is already in the main Zig compiler's repo, although currently I don't think it actually does any compilation of C (unless you explicitly disable LLVM) and is mostly used for Zig's "translate-c" functionality, last I checked.

Re: Aro – Zig's new C compiler

#78

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!

Even the about section on Github is "A C compiler written in Zig". This goes against the guideline of Editorialise the headline.

Re: Aro – Zig's new C compiler

#79
post #16

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.

D is so underrated. Keep up the good work Walter.

I am pretty sure that most of the language design is done by Andrei Alexandrescu now.

Re: Aro – Zig's new C compiler

#80
post #68

Earlier quoted context omitted.

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…

makes sense. not too different from the market for operating systems or enterprise software. both suffer from the same malady. we need a remedy. :)
Post reply on HN