Trying to Learn Zig, Advice Required - I'm hitting a lot of Deprecations, Package Manager Compatibility issues

Hey Ziggit,

I’m a go dev, trying to learn zig by creating a few easy projects, like a cli tool to get weather, a downloader, etc.

Here’s my approach to things and what i tried

I come across tutorials that mention how to make a http request, its 1 year old, not when i copy and paste the code it wont work. The code is using deprecated apis and now i spend another 10 minutes finding a working tutorial.

Next i find packages that tutorials ask to install, luckily zig has a package manager now? happy_face.jpg

Install package, compile fails. check logs and try to debug, this package isn’t compatible on macos or windows.

Finally I find after 1 hour i find a http request tutorial. now i need to find a cli parser package for zig that works.

Everytime i try to learn zig there’s incompatibilities or deprecations. I keep hitting roadblocks trying to learn zig.

Any advice in how to approach zig?

That’s the pain with using a language that’s still changing frequently :slight_smile:

One thing that really helped me was reading the stdlib code; it’s obviously always up to date and pretty readable (for the most part at least).

It’s probably also a good idea to stick to a single release instead of tracking the master branch. The latest one is 0.15.2, so you could specifically look for tutorials and packages that also use this version (be warned though, 0.16 is going to introduce quite major breaking changes with the new Io interface)

Zig also has excellent C interop, so if there’s a well-established C library that fits your use case you could try using it in a Zig program, that way you don’t have to deal with outdated packages and lacking documentation.

And there’s of course spaces like this forum where you can ask for help if you’re stuck anywhere!

2 Likes

Ah, The woes of coming in at a time when large changes have occurred. And will continue to occur for a bit.
I understand your frustration.

I remember a post asking about how to make a simple http request within ziggit using 15.2~. This should have some information for you.

My two cents, though not terribly fun:

If there are any video tutorials older than 15.2 release, they are likely deprecated. Outside of things like the package manager or basic concepts.

Otherwise… It may be useful to go back a few versions and spend an hour or two to read through the release notes until now and take notes. There is a lot of information tucked throughout, that may lead to answers not found in the documentation, yet.

1 Like

for changes in API, I check the release note (blog post) and use that to figure out what to change.

I also browse the stdlib docs to figure out if the namespace changed between release. But usually it’s just looking at the release notes