Zig package manager and not/feat

Hi everyone,
I’m thinking about starting to program in Zig, but I want to learn certain features before I begin. Does Zig have any package management system like Cargo in Rust? or npm in JS?

Is Zig planning to include async/await and concurrency natively?
And finally, what features will definitely not be coming to Zig?

Sorry for my ignorance. I want to learn and get started, but I need to clarify some questions. Thank you. Best regards.

1 Like

Does Zig have any package management system like Cargo in Rust? or npm in JS?

It has something similar, but it’s simpler and still a work in progress in some areas.

Is Zig planning to include async/await and concurrency natively?

Yes. This is a current major focus of development for the Zig team.

And finally, what features will definitely not be coming to Zig?

This is hard to answer, because the answer is infinitely long, and also in some ways pointless.

Some obvious ones:

  • RAII
  • Features with a focus on supporting object oriented programming (eg, subclassing)
  • Features with a focus on supporting functional programming
  • Macros (see comptime, which is better)

The more pragmatic answer to the question: Try out the language, get a feel for how idiomatic code works. Watch some talks by the Zig team. That flavor is unlikely to significantly change through addition of new features.

You can also see rejected proposals here: GitHub · Where software is built

7 Likes

Great answer!

A few more specific not-coming features that are frequently asked about:

  • Errors with payloads (you have to use a separate context/param for the payload)
  • Block expressions (you have to use a label and break)
  • Closures (there is no way to capture)

FWIW, the lack of these features (and others listed in github issues) is not a big problem for me, and in fact their omission has advantages that often outweigh their usefulness. That’s in addition to the advantage of keeping the language fairly simple and straightforward.

1 Like

Welcome to zig!

Does Zig have any package management system like Cargo in Rust? or npm in JS?

Yes however it’s fairly simple and not nearly as powerful, however it is a WIP and will receive upgrades.

Basically we just use zig fetch --save git+<github-url> which just pull the “package” into your project, you still have to add it to your build.zig manually most “packages” or libraries seems like a better word for it will have instructions on how to do just that.

Is Zig planning to include async/await and concurrency natively?

It was planned for a release last year but got postponed. The reasoning behind it was that the zig team wants to do it right and not have it feel like it was just bolted on. So far recent updates to how it will be done seem promising and unique.

And finally, what features will definitely not be coming to Zig?

Uhm odd question :slight_smile: we don’t know? Usually with programming languages it’s much easier to say which features it does have than which it does not have…

Sorry for my ignorance. I want to learn and get started, but I need to clarify some questions.

It’s a fairly “new” language learning and exploration is welcome.