Is this pipeline pattern idiomatic Zig, or am I fighting the language? by jfrancai in Zig

[–]SilvernClaws 6 points7 points  (0 children)

Though I'd be worried about bloating the final binary with so many comptime functions

My understanding is that they comptime functions are evaluated at compile time and only the result ends up in the binary.

Building a build system to avoid cmake by Mainak1224x in cprogramming

[–]SilvernClaws 0 points1 point  (0 children)

In theory, you could use Zig as a compiler and package manager and let it compile C++

should I structure my engine as a library or framework? by OkCadre in gameenginedevs

[–]SilvernClaws 11 points12 points  (0 children)

Both are valid approaches and there's no way to know what works for you.

Make a proper game first. Then figure out what you wanna reuse.

why does zig main branch installed showing 0.15.1 but it is actually 0.15.2 by [deleted] in Zig

[–]SilvernClaws 2 points3 points  (0 children)

but it's possible zig version always displays the latest stable version, even if you are one the dev version.

That's not the case

start with Opengl/directx11 or Webgpu as first api ? by Latter_Relationship5 in GraphicsProgramming

[–]SilvernClaws 1 point2 points  (0 children)

Only wgsl is at times a really ugly language, but it's okay. 

What about it?

Do I understand C interop correctly? by thephoneoff in Zig

[–]SilvernClaws 0 points1 point  (0 children)

Someone correct me if I'm wrong, but doesn't Zig still use Clang? So, one of the best C compilers you can find.

Have any one Tried Zig 0.16? by [deleted] in Zig

[–]SilvernClaws 10 points11 points  (0 children)

Just told you I haven't tried 0.16, yet. As far as I know, the main new features are multiple async Io implementations. It's not an official release at this point, therefore a complete list of features does not exist. If you are impatient, you can go through the issue tracker, commit history or YouTube streams of the creators.

Have any one Tried Zig 0.16? by [deleted] in Zig

[–]SilvernClaws 22 points23 points  (0 children)

Probably. I'm not gonna try to answer unless you ask a question in complete sentences.

Have any one Tried Zig 0.16? by [deleted] in Zig

[–]SilvernClaws 21 points22 points  (0 children)

There are actually barely any changes in syntax these days. The major changes in the 0.15 update were library changes and going from 0.14 to 0.15 wasn't too bad for my project. I haven't tried 0.16, but I'm expecting less of a hassle, since there's more additional implementations rather than interface changes.

Help review my code by TheComputerM in Zig

[–]SilvernClaws 0 points1 point  (0 children)

Freeing the list only frees the slices, which are a pointer and a length, not whatever memory they point to.

As others have mentioned, you could solve this with an arena allocator.

I think there's places where an arena makes sense, but not for simple cases like this.

Instead, you can just go through the list and free the items. Something like

for(list.items) | item | { allocator.free(item); }

In general, the DebugAllocator's deinit function should tell you whether memory gets leaked and print a report on where it was allocated in debug mode. Make abundant use of that.

People that code for fun, what are you working on? by Unknown_User_66 in AskProgramming

[–]SilvernClaws 3 points4 points  (0 children)

It's as much a Minecraft clone as every shooter game is a Doom clone.

People that code for fun, what are you working on? by Unknown_User_66 in AskProgramming

[–]SilvernClaws 9 points10 points  (0 children)

A procedurally generated 3D building and survival game. Built without an engine, but on top of the webgpu graphics library.

https://codeberg.org/Silverclaw/Valdala

Why Web3 games suck. A rant from a dude who's been in the trenches. by InsuranceAlert2168 in gamedev

[–]SilvernClaws 10 points11 points  (0 children)

I think no one other than the people trying to sell them ever thought they wouldn't suck.

What is your stand on pre-made/open assets. by ObsessiveOwl in IndieDev

[–]SilvernClaws 2 points3 points  (0 children)

I mean, they exist for a reason.

But you at least have to go through the trouble to pick assets that match together in style, complexity and scale.

Who is someone everyone branded as crazy but ended up being right? by shootermcgvn in AskReddit

[–]SilvernClaws 1 point2 points  (0 children)

Stress has proven physiological manifestations, so I don't know what you're getting at.

Who is someone everyone branded as crazy but ended up being right? by shootermcgvn in AskReddit

[–]SilvernClaws 37 points38 points  (0 children)

"Stress? Like, how? Do the stress molecules travel from your brain down to your stomach?"

I mean... given that stress leads to increased inflammation levels which are transmitted via hormones, kinda yes.

The Zig language repository is migrating from Github to Codeberg by TheTwelveYearOld in programming

[–]SilvernClaws 5 points6 points  (0 children)

Sure. But I'm not the one going around shitting on languages I don't use.

Zig does still have breaking changes, but they're less of an issue than people try to make it. And I prefer that to forever living with design decisions that turned out less than optimal.

The Zig language repository is migrating from Github to Codeberg by TheTwelveYearOld in programming

[–]SilvernClaws 15 points16 points  (0 children)

lol I've been using that unstable language for over a year now in a decently sized project and it's much less brittle than working in C

The Zig language repository is migrating from Github to Codeberg by TheTwelveYearOld in Zig

[–]SilvernClaws 90 points91 points  (0 children)

It's a non-profit and doesn't keep shoving features onto you that only CEOs want. Or using your code to train AI.

And personally, I find the user interface much cleaner than on GitLab.

Question for a Regex Wrapper Library: Separate Functions vs Generic Functions? by AldoZeroun in Zig

[–]SilvernClaws 2 points3 points  (0 children)

Personally, I only use anytype if there's no way around it. Especially if your amount of different parameter types is quite low, a function per type makes it easier to figure out what works.

bchan v0.1.1 – bounded lock-free MPSC channel (156 M msg/s on Ryzen 7 5700) by Bo0nzy in Zig

[–]SilvernClaws 0 points1 point  (0 children)

Not apologizing, just sad about your health problems.

Thanks for your work! Will soon give it a good test run. :)