Live data from Hacker News

Aro – Zig's new C compiler

github.com

101–110 of 130 posts

Re: Aro – Zig's new C compiler

#101
post #84

I hope Zig adds complex numbers before it is too late. It's a pity that they did not steal array syntax and slices from Fortran/Numpy.

Odin makes them (and more!) absolutely lovely to work with:

complex32/64/128, quaternion64/128/256

https://odin-lang.org/docs/overview/#array-programming

https://odin-lang.org/docs/overview/#matrix-type

Probably helps it's the language JangaFX uses for their products used by essentially every major video game, movie, and TV show out there (https://jangafx.com/#headline-603-384)

Re: Aro – Zig's new C compiler

#102
post #86

Earlier quoted context omitted.

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

Given Zig has one, it might actually be possible to delegate to that then? It would be awesome to have a post explaining how to do that :)

The older “cross compiling Go with Zig” post might give a good start if you want to figure it out

Re: Aro – Zig's new C compiler

#103
post #29

Earlier quoted context omitted.

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

And just by virtue of being about C compilers, it is also about C, thereby making all talk about programming languages on-topic? I see your point about other C compilers being related, but following this line of thought, most any topic could be generalised to whatever you want.

Generally speaking, the more you stray from the most concrete topic at hand (in this case Aro and only Aro), the more it becomes appropriate to explain and elaborate on the relation between that and whatever you've decided to talk about instead. In my view, anyway.

Re: Aro – Zig's new C compiler

#104

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!

Yep. @dang, per HN guidelines the title should be updated to "A C compiler written in Zig"

Re: Aro – Zig's new C compiler

#106
post #93
post #91

Earlier quoted context omitted.

Why would complex numbers in particular deserve to be a native type? What about quaternions, or vectors and matrices of sizes 2-4 at least? Is there any real advantage over just using a struct? Would MultiArrayList help with performance for complex numbers and vectors?

Zig doesn't (and never will) have operator overloading, so using any user-defined numeric types is awkward. It also already has vector types.

This is IMO the canonical use case of operator overloads. Are you proposing adding complex numbers to the standard lib to circumvent that restriction, vice addressing it?

Re: Aro – Zig's new C compiler

#107
post #84

I hope Zig adds complex numbers before it is too late. It's a pity that they did not steal array syntax and slices from Fortran/Numpy.

This is simple to add; struct with two fields, and a handful of methods + operator overloads.

Why did not I think of that, shame on me.

Re: Aro – Zig's new C compiler

#108
post #84

I hope Zig adds complex numbers before it is too late. It's a pity that they did not steal array syntax and slices from Fortran/Numpy.

Odin makes them (and more!) absolutely lovely to work with: complex32/64/128, quaternion64/128/256 https://odin-lang.org/docs/overview/#array-programming https://odin-lang.org/docs/overview/#matrix-type Probably helps it's the language JangaFX uses for their products used by essentially every major video game, movie, and TV show out there ( https://jangafx.com/#headline-603-384 )

True, but column-major by default and 1-indexed unfortunately. Still quite nice that they are addressing these challenges head-on early stage unlike other new langs. I guess they had their share the pain like the rest of us.

Re: Aro – Zig's new C compiler

#109
post #97

Earlier quoted context omitted.

I'm curious, what use cases do you have for complex numbers that couldn't be provided in a 3rd party library or maybe even the stdlib?

You are essentially necromancing the ISO C99 discussion that happened already. Here is an answer that, after 25 years, is still wrong https://learn.microsoft.com/en-us/cpp/c-runtime-library/comp...

That doesn't tell me much about the usage scenario of complex numbers that would justify adding native support in programming languages. As a sibling comment said, builtin vector and matrix types (up to 4 dimensions) would probably be more useful.

Re: Aro – Zig's new C compiler

#110
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.

He's right, what he's saying is just so obvious it's annoying it has to be said in reply to low effort posts like yours
Post reply on HN