Meow Kingmeowking.hashnode.dev·Nov 15, 2024Zig C Integration NoteC function take a function as parameter Take stb image library as example: int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); int stbi_write_bmp_to_func(stbi_wri...Zig Noteszig
Meow Kingmeowking.hashnode.dev·Nov 14, 2024Zig Build System Notes(Tested in Zig 0.13.0) Don’t use addCSourceFile to add a same C libraries that your dependent Zig libraries uses, it will produce an error like ld.lld: duplicate symbol: stbi_failure_reason. Only include the C header path using addIncludePath. For c...3 likesZig Noteszig
Dayvi Schusterdayvster.hashnode.dev·Oct 6, 2024Read Directory Contents With ZigEfficiently Reading Directory Contents in Zig with a Page Allocator Hey there welcome back to my Zig series, the language that I've been using a lot lately for my hobby projects. It's a language that keeps evolving and I'm excited to share more about...zig
Adewole Caleb Erioluwacaleberioluwa.hashnode.dev·Oct 3, 2024A Detailed Examination of Zig's Memory PoolIn a bid to understand how the memory pool works, I dug into the Zig memory pool source code. I plan to read the code for the allocator in the heap folder of the std library. Let’s look at what it does and how it does—starting from the first error me...10 likes·76 readslearning-zig
Tristan Durettristanduret.hashnode.dev·Sep 23, 2024Gemini, which project should I start ?I like to think of AI models as what you get when you moosh all content creator in a single entity (including the bad ones). But I watch enough House MD to know that even bad idea can detonate good ones. Instead of a little army of resident, I have G...zigzap
Adewole Caleb Erioluwacaleberioluwa.hashnode.dev·Sep 16, 2024Exploring Zig: My Experience and InsightsIt has been a while since I have written anything, I still have some pending articles to complete in golang but for the fun of it, let me tell you what I have been up to lately. I piqued an interest in Zig about two months ago since I have been inter...47 readszig
Tristan Durettristanduret.hashnode.dev·Sep 6, 2024ASCII Game of Life in Zig !After 7 years of code, 2 of which professionally, one might think I would have already done it, but no... I was today years old when I made my first game of life project! I wanted to explore Zig and become better at it, so I decided to play a bit wit...game of life
csmcsm.hashnode.dev·Aug 26, 2024zig: CommentsZig has only single-line comments, but with three variants: Normal comments: // This is a comment! std.debug.print("hello world!",.{}); // This is also a comment! doc-comments: /// This function prints 'hello!' top-level doc comments: //! T...zigziglang
csmcsm.hashnode.dev·Aug 11, 2024zig: First ProgramOverview: A simple program that prints a message to the terminal. Note: I am showing you how to run a simple program, not a whole zig project setup(that will be covered later). Steps: Create a folder 'hello' at a location of your choice. Mine is l...zigziglang
csmcsm.hashnode.dev·Aug 9, 2024zig: SetupRequirements: os: linux mint zig version: 0.13.0 vs code (with zig extension) Steps: Download zig package of version 0.13.0 from zig's website. Unpack it in a place of your choice. Add zig binary path to PATH environment variable: Add this l...zigziglang