Live data from Hacker News

Zig is now self–hosted by default

github.com

11–20 of 115 posts

Re: Zig is now self–hosted by default

#11

To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…

Thanks for the context!

What's the difference between the stage2 and stage3 binary? Does stage1 produce different binaries for the same input compared to stage2/stage3?

Re: Zig is now self–hosted by default

#12
post #9

Earlier quoted context omitted.

I believe the goal is to replace the C++ with a C bootstrap that is initially auto generated from the zig code by zig but manually cleaned up and maintained to match

Starting from auto-generated code isn't considered a proper bootstrap process by the Bootstrappable Builds project. You need to be able to start without any binaries or auto-generated code from the project itself. Usually that would mean starting with a basic implementation in another language, but starting with an older version of the same project that was written in another language and then going through several o…

Please read comments before responding

Re: Zig is now self–hosted by default

#13

To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…

> having better debug tooling

What debug tooling are you referring to? It seems like people just use lldb to debug zig programs?

I'm honestly interested, and searching doesn't turn up good tools as far as I can tell.

Re: Zig is now self–hosted by default

#14

To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…

> Case in point: the new self-hosted compiler is 1.5x faster than the C++ implementation and uses 3x less peak RAM.

I am not sure it is comparable: the self-hosted compiler uses a different architecture [1].

[1] https://vimeo.com/649009599/7f1fda43ff

Re: Zig is now self–hosted by default

#15

Oh boi, oh boi, oh boi, oh boi, this is a historic moment. I think at the current rate I will start focusing my energy on learning and using Zig when version 0.12.0 is out :) Awesome work guys. I am so looking forward to this language!

You can use it today!

Re: Zig is now self–hosted by default

#16

To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…

> Case in point: the new self-hosted compiler is 1.5x faster than the C++ implementation and uses 3x less peak RAM. I am not sure it is comparable: the self-hosted compiler uses a different architecture [1]. [1] https://vimeo.com/649009599/7f1fda43ff

This is true, but I don't think your point entirely fair either. Zig's design lends itself to writing this style of code. In contrast the usual way(s) C++ is used encourages code that makes these types of optimizations hard/impossible. In practical terms, if you wanted to write fast software, the ergonomics of the language allowing you to use the desired architecture matter a lot.

(Also, you're replying to the primary author of Zig and presenter of that talk, if you weren't aware.)

Re: Zig is now self–hosted by default

#17

To clarify what this means, since things can get confusing with subtle differences in wordings: * stage1 is when zig is built from C++ code[1] (the "bootstrap" compiler) using system C/C++ compiler toolchain. * stage2 is when zig is built from Zig code[2] using stage1. * stage3 is when zig is rebuilt from the same Zig code[2] using stage2. Before today, zig would give you stage1 by default, and you could opt in to st…

Hi Andrew, sorry for the unrelated question but where can we find the financial reports of the Zig Software Foundation for 2022? The Finances spreadsheet hasn't been updated for the past half a year:

https://docs.google.com/spreadsheets/d/14_ljFHGFXY5NhBhlfjgk...

Re: Zig is now self–hosted by default

#20

Oh boi, oh boi, oh boi, oh boi, this is a historic moment. I think at the current rate I will start focusing my energy on learning and using Zig when version 0.12.0 is out :) Awesome work guys. I am so looking forward to this language!

You can use it today!

Is there any IDE support? Any debugger?
Post reply on HN