Hacker News new | past | comments | ask | show | jobs | submit login
Zig 0.10.0 Release Notes (ziglang.org)
106 points by kristoff_it on Oct 31, 2022 | hide | past | favorite | 23 comments



BTW: if anyone wants to jump into Zig, for me the most efficient way was reading the stdlib and also using github codesearch - just type a function name with suffix lang:zig and you get a real-world usage.


I cannot stress how github code search is helping me! Gotta be the best productivity tool recently


Similarly: https://grep.app/ has been my #1 tool while learning Erlang.


Are there any tutorials on this to use it much efficiently?


I just search up things I'm working with. For example, I'm learning the Erlang library "PropEr", which doesn't have great documentation. One of the main functions/macros that proper uses is ?FORALL, so I search ?FORALL in grep.app and see how people are using it. If I want to narrow the cases down, I use the regex search.


I am learning Rust RN, I wish I could see the real world examples for the topic I am learning. Can you please disclose your way of using GitHub search in detail or any resource on the topic if possible?


I don't have a much else to add: I open the github codesearch at https://cs.github.com/

and I type there something like `"someMethod(" lang:zig`, then I open several results in a new tab and quickly skim through that and close the ones which are not interesting, and that's pretty much it


For those interested, we're hosting a Zig release party tomorrow (November 1st) on Twitch:

https://old.reddit.com/r/Zig/comments/ygiir2/release_party_a...


The most important note of this release is that Zig is now self-hosted; it is capable of compiling itself.

I've been learning Zig as a side project for a couple months now. It's been kind of hard since I don't have a lot of experience with low-level coding and Zig is a bit less user-friendly than Swift, but the folks in the IRC channel (and yes, its primary real-time chat community is an IRC channel, not some Slack/Discord nonsense) have always been super friendly with this newbie, right up to the project lead himself. I really suggest you give Zig a look if you want to have some fun learning a new language.


> and yes, its primary real-time chat community is an IRC channel, not some Slack/Discord nonsense

As a counterpoint, I have only interacted with the Discord communities and they've been great for all my dumb questions! I barely go a minute before getting a response when I ask something.

Whether you prefer IRC or Discord, it sounds like you're well supported by the chat communities.


I'm in the same boat, I've used Zig to go through AoC 2021, liked it. I know some C, as in worked through K&R years ago, but I possess little practical experience.

Any recommendations for resources/books to learn knowledge and programming patterns applicable to Zig?(memory management best practices, low level programming, et cetera)


what's wrong with discord? the community there is awesome and very helpful.


Discord and other Electron-based chat software provide very little practical improvement over IRC for the purpose of discussion while requiring 10-100x the resources.


Awesome, thank you for your work, all of you. I am not easily impressed but I think Zig is THE next big thing.


Is there an overview of a real world small project using zig vs rust vs cpp20?



Wow, thank you!


Not exactly that but I've been working on a collection of small but meaningful programs in major languages: github.com/eatonphil/tinyprograms. There's Zig, Rust, Go, Python, D, FreePascal, Java, Ruby, etc.


Sick release notes cheers Kristoff and team


Congratulations on the release!


ELI5: Why zig matters, while we already have rust, python, JavaScript and Go?


Well, Python, JS and Go all have different goals than Zig. You also can't write low-level stuff with them, mostly. Actually, you can (with TinyGo and MicroPython), but they're not what these languages are designed for so you'll most likely be on your own.

Rust is a whole another conversation. You can pretty much do whatever you can do in Zig with Rust, and Rust has the advantage of hardcore memory safety using the borrow checker. It is also a very nice language to use, but it is complicated.

You see, Zig is sort of the C to Rust's C++. I don't mean this in the sense that Zig can't replace C++ (it can) or Rust can't replace C (it can), but it is obvious that C is a simpler language to learn than C++.

So yeah, you kind of don't need Zig when you have Rust and willing to use it for everything, but if you don't want to deal with a complicated language and the borrow checker, Zig is the language for you. It is basically C with some footguns removed + some features added (tagged unions, proper error handling, etc).

Ah, and Rust has long compile times. It is being worked on since 2013 [0] or earlier. Zig is serious about their compile times as you can read about the self-hosted backends for debug compilation speed in the release notes.

I don't know if Rust has any production-ready alternative backends that are fast. People always say LLVM is the reason Rust is slow to compile and you can use cargo check to confirm that, but it is obvious that is more of a priority for Zig team when compared to Rust team.

I sort of don't care about compile times of Rust at this point since the guarentees Rust make is more important to me than the compile times, but that may not be the case for everyone. I'll also use Zig when it is stable enough for my taste for non-safety critical stuff.

[0] https://news.ycombinator.com/item?id=6537005


Do more with less. This release already shows well-thought-out design layer shared ABI code for backends .. and optimized generated wasm looks like a killer. Small binary size than Rust, easier to optimize, "proof|correctness" can't help you here!




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: