News for hackers. Stuff that matters.
Re:Long story short: I wrote a Ruby extension in Zig by 1f60c on Monday December 26, 2022 @05:28AM (#34136425)
How do y’all find out how to do things in Zig? The documentation as it currently exists is very brain dumpy (which makes sense, as the language is still young), so it’s hard for me to find exactly what I’m looking for.
Re:Long story short: I wrote a Ruby extension in Zig by modernerd on Monday December 26, 2022 @06:04AM (#34136631)
The Zig Programming Language Discord has a zig-help channel that's pretty responsive if you're ok with Discord. The archive is searchable.

https://github.com/ziglang/zig/wiki/Community#discord-englis....

GitHub's code search beta is a good way to find out how other people are doing things with Zig, if you have access to it. For example:

https://cs.github.com/?scopeName=All+repos&scope=&q=http+pat...

Some less-known walkthroughs for those new to Zig but comfortable in other languages:

- A half-hour to learn Zig: https://gist.github.com/ityonemo/769532c2017ed9143f3571e5ac1...

- Zig Crash Course: https://ikrima.dev/dev-notes/zig/zig-crash-course/

You can also see how other people have solved problems you might have:

https://github.com/catdevnull/awesome-zig

Re:Long story short: I wrote a Ruby extension in Zig by 1f60c on Monday December 26, 2022 @06:24AM (#34136752)
Thank you!

Note that improvements from GitHub Code Search have been integrated into the main website, which means you can do something like this:

https://github.com/search?q=lang%3AZig%20%2F%22https%3F%3A%5...

Re:Long story short: I wrote a Ruby extension in Zig by jeltz on Monday December 26, 2022 @06:51AM (#34136919)
I read the source code for the standard library.
Re:Long story short: I wrote a Ruby extension in Zig by jcmoyer on Monday December 26, 2022 @07:48AM (#34137244)
Reading the manual, searching the stdlib for terms related to what I'm trying to do and reading tests, searching the issue tracker, and accidentally discovering things via LSP autocomplete. For higher level concepts that aren't implemented in language (like runtime polymorphism), I try to find examples of how it's done in the stdlib and copy that.