135 karma · joined Dec 9, 2019 (6y ago) · 26 submissions
comment 2y ago · link · parent
Some notable changes in zig.guide since Zig 0.11 came out:
- Changed from following master, to following major releases (Zig is more stable now, less work for me. Yay.).
- Migrated from Hugo to Docusaurus, bringing some large frontend improvements.
- Moved over from ziglearn.org to zig.guide.
- Removed 'usage in production is not recommended' from the front page.
- Support for versioning.
- Greatly improved testing through build.zig.
- Opened up for github sponsorships.
- Added another section for supplementary walkthroughs.
The site still isn't nearly where I want it to be but there's been some big improvements in the last few months.comment 4y ago · link · parent
comment 4y ago · link · parent
Assuming this is you also. There were commits to Zig less than an hour before you posted this.
comment 4y ago · link · parent
I'm assuming you're the same person that made multiple new stack overflow accounts recently to ask (and answer, on a different account) this question here: https://stackoverflow.com/questions/74040564/is-the-zig-prog... (since removed by moderators).
My question to you is: Why are you trying to force this false narrative?
comment 5y ago · link · parent
I've happened to have written a lot of C, but some areas (like this one) I'm not as confident in. This way of casting, and working with types is very poor syntax in my opinion (I mean below in this thread you have people arguing about the spiral rule and such, it's obviously a common confusion).
Zig's way of expressing types and pointers is far superior, these transformations I made were done quickly and I didn't feel like there was any ambiguity or confusion in anything. Just a series of simple reductions, there are no "tricks" or easy mistakes to make in the code. It feels like a trivial proof.
Obviously I am biased, this was posted to zig.news. I thought it was a neat showcase of translate-c, and how zig does some of these things nicer. I'm not telling everyone that they should do what I did, but this works for me and I'm happy to share.
comment 5y ago · link · parent
comment 5y ago · link · parent
If you make code that requires allocation and does not have an allocator passed into it, there is literally nothing stopping you from allocating anyway. Zig does not stop you from, for example, heap allocating without the usage of an allocator (Zig does not know what heap allocation even is). You can directly use the std page_allocator (and others) wherever you want, too.
There are very few good reasons to do this (e.g. spawning a thread requires particular allocation; using an allocator might not be sound depending on the OS).
All you have to do is document that it allocates memory and that's fine; there is no split.
comment 5y ago · link · parent
At a language level, zig does not have a "new" or a "malloc" or anything of the sort.
comment 5y ago · link · parent
https://ziglearn.org/chapter-2/#iterators
I don't think that going further into parsing is in scope. std.log is something that definitely needs to be covered. HTTP, I'm not sure about as it requires a lot of extra machinery outside of the standard library and these things aren't mature yet.
comment 5y ago · link · parent
https://ziglearn.org/chapter-2/#filesystem
And details on reading the next line here:
https://ziglearn.org/chapter-2/#readers-and-writers
fread/fstat/fgets/fopen is now all covered. The build system is something I need to cover much more thoroughly, but is something that will take a long time.
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
edit: to clarify I am the maintainer/owner of ziglearn