# Challenge

**URL:** https://ziggit.dev/c/challenge/11.md

[Latest](https://ziggit.dev/latest.md) · [Categories](https://ziggit.dev/categories.md) · [Tags](https://ziggit.dev/tags.md)

---

## [About the Challenge category](https://ziggit.dev/t/about-the-challenge-category/2222)

<div class="topic-metadata">

**Author:** [@ziggit](https://ziggit.dev/u/ziggit)\
**Replies:** 0\
**Last updated:** [November 19, 2023, 11:24am UTC](https://ziggit.dev/t/about-the-challenge-category/2222 "2023-11-19T11:24:03Z")

</div>

Do you have a Zig challenge you’d like to propose to the community? You’ve come to the right place! The Challenge category is broad and dedicated to Zig coding problems and tasks. Using the category Challenges can inclu…

---

## [Ministry of silly loops](https://ziggit.dev/t/ministry-of-silly-loops/11383)

<div class="topic-metadata">

**Author:** [@matklad](https://ziggit.dev/u/matklad)\
**Replies:** 16\
**Last updated:** [October 4, 2026, 1:26pm UTC](https://ziggit.dev/t/ministry-of-silly-loops/11383 "2026-10-04T13:26:25Z")

</div>

It’s 3AM here, and, for whatever reason, I cannot sleep because I am thinking about Zig loops. Silly Zig loops specifically. What is the silliest Zig loop you can manage? One loop per post please!

---

## [Spot the bug: parsing a zon file](https://ziggit.dev/t/spot-the-bug-parsing-a-zon-file/16332)

<div class="topic-metadata">

**Author:** [@jeffective](https://ziggit.dev/u/jeffective)\
**Replies:** 2\
**Last updated:** [June 25, 2026, 6:27am UTC](https://ziggit.dev/t/spot-the-bug-parsing-a-zon-file/16332 "2026-06-25T06:27:58Z")

</div>

pub fn fromFile(io: std.Io, allocator: std.mem.Allocator, file\_path: \[\]const u8) !gcat.Arena(Config) { const arena = try allocator.create(std.heap.ArenaAllocator); errdefer allocator.destroy(arena); arena.\* =…

---

## [Psycho C struct](https://ziggit.dev/t/psycho-c-struct/16274)

<div class="topic-metadata">

**Author:** [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Replies:** 4\
**Last updated:** [June 21, 2026, 11:37am UTC](https://ziggit.dev/t/psycho-c-struct/16274 "2026-06-21T11:37:18Z")

</div>

I was compiling something that relies on Translate-C. When I accidentally used aarch64-linux instead of aarch64-linux-gnu as the target, I got an “opaque types have unknown size and therefore cannot be directly embedded …

---

## [Non-error fixed buffer printing](https://ziggit.dev/t/non-error-fixed-buffer-printing/16241)

<div class="topic-metadata">

**Author:** [@Southporter](https://ziggit.dev/u/Southporter)\
**Replies:** 7\
**Last updated:** [June 19, 2026, 6:46am UTC](https://ziggit.dev/t/non-error-fixed-buffer-printing/16241 "2026-06-19T06:46:13Z")

</div>

I have a fixed buffer (i.e. \[128\]u8) that I want to print into. I could use std.fmt.bufPrint or Writer.print, however, these will error if what I want to print is over the buffer length. Normally, that’s a good thing. Ho…

---

## [Should the Zig community fork bun?](https://ziggit.dev/t/should-the-zig-community-fork-bun/16212)

<div class="topic-metadata">

**Author:** [@spirobel](https://ziggit.dev/u/spirobel)\
**Replies:** 9\
**Last updated:** [June 17, 2026, 10:46am UTC](https://ziggit.dev/t/should-the-zig-community-fork-bun/16212 "2026-06-17T10:46:30Z")

</div>

honestly i loved the handmade vibe of bun in the beginning but now it seems like the project is going in the wrong direction. possible improvements the zig community could make by forking bun: show recognition to the …

---

## [It Took me 2 Hours to just write a Read Directory Code](https://ziggit.dev/t/it-took-me-2-hours-to-just-write-a-read-directory-code/16070)

<div class="topic-metadata">

**Author:** [@vrianta](https://ziggit.dev/u/vrianta)\
**Replies:** 4\
**Last updated:** [June 11, 2026, 6:53am UTC](https://ziggit.dev/t/it-took-me-2-hours-to-just-write-a-read-directory-code/16070 "2026-06-11T06:53:17Z")

</div>

I joined in the wrong time or it is intentionally, made to make it hard for new commerce to coup with Zig. Why it is mind stretching and difficult to right a code to fetch any dir or file, for this simples tasks can’t w…

---

## [Canonical loop structure for reductions](https://ziggit.dev/t/canonical-loop-structure-for-reductions/15011)

<div class="topic-metadata">

**Author:** [@matklad](https://ziggit.dev/u/matklad)\
**Replies:** 13\
**Last updated:** [April 24, 2026, 9:08pm UTC](https://ziggit.dev/t/canonical-loop-structure-for-reductions/15011 "2026-04-24T21:08:55Z")

</div>

One thing I like about Zig is that, while in general the language is minimal, it has a very rich vocabulary of control flow constructs (labeled block, break out of loop with value, for/else). So, for example, expressing…

---

## [A Rare Bug in Audio Code by Zig’s Creator — Can You Find It?](https://ziggit.dev/t/a-rare-bug-in-audio-code-by-zig-s-creator-can-you-find-it/11366)

<div class="topic-metadata">

**Author:** [@marler8997](https://ziggit.dev/u/marler8997)\
**Replies:** 7\
**Last updated:** [April 19, 2026, 12:38pm UTC](https://ziggit.dev/t/a-rare-bug-in-audio-code-by-zig-s-creator-can-you-find-it/11366 "2026-04-19T12:38:48Z")

</div>

Considering how much of Andrew’s code I’ve seen, bugs are abnormally rare. Well… that makes today special…I actually found one! It’s in an example he wrote in his pulseaudio fork (very mission-critical code, of course). …

---

## [What's missing in DDB.zig? Help me pick the next data types](https://ziggit.dev/t/whats-missing-in-ddb-zig-help-me-pick-the-next-data-types/14911)

<div class="topic-metadata">

**Author:** [@Neon32eeee](https://ziggit.dev/u/Neon32eeee)\
**Replies:** 0\
**Last updated:** [April 13, 2026, 2:45pm UTC](https://ziggit.dev/t/whats-missing-in-ddb-zig-help-me-pick-the-next-data-types/14911 "2026-04-13T14:45:16Z")

</div>

:bar\_chart: DDB.zig: what data types do you need? Hey! I’m the author of DDB.zig — a tiny embedded db for Zig. Right now the lib supports four types: int (i32) • str • bool • float (f64) Question for the community: …

---

## [Vulkan Mystery](https://ziggit.dev/t/vulkan-mystery/14452)

<div class="topic-metadata">

**Author:** [@marler8997](https://ziggit.dev/u/marler8997)\
**Replies:** 5\
**Last updated:** [March 1, 2026, 8:52am UTC](https://ziggit.dev/t/vulkan-mystery/14452 "2026-03-01T08:52:58Z")

</div>

I’ve created a static linux binary that can use vulkan! You can find the code at GitHub - marler8997/vow: Vulkan Over the Wire However, before looking at the code to see how it was done, I’ve uploaded a prebuilt 250Kb …

---

## [What's the most cursed Zig you can write?](https://ziggit.dev/t/whats-the-most-cursed-zig-you-can-write/9001)

<div class="topic-metadata">

**Author:** [@jeffective](https://ziggit.dev/u/jeffective)\
**Replies:** 20\
**Last updated:** [December 20, 2025, 1:44pm UTC](https://ziggit.dev/t/whats-the-most-cursed-zig-you-can-write/9001 "2025-12-20T13:44:51Z")

</div>

What’s the most cursed Zig you can write? I’d like to see some code that makes your skin scrawl, or mutter to yourself “wtf is this?”. Some ideas to get you started: Write a panic handler that allows you to ignore / r…

---

## [AoC 2025: Day 10](https://ziggit.dev/t/aoc-2025-day-10/13455)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 8\
**Last updated:** [December 16, 2025, 2:12pm UTC](https://ziggit.dev/t/aoc-2025-day-10/13455 "2025-12-16T14:12:03Z")

</div>

Main thread for Day 10 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has cha…

---

## [AoC 2025: Day 9](https://ziggit.dev/t/aoc-2025-day-9/13445)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 4\
**Last updated:** [December 15, 2025, 9:13pm UTC](https://ziggit.dev/t/aoc-2025-day-9/13445 "2025-12-15T21:13:46Z")

</div>

Main thread for Day 9 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 12](https://ziggit.dev/t/aoc-2025-day-12/13479)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 5\
**Last updated:** [December 14, 2025, 12:51pm UTC](https://ziggit.dev/t/aoc-2025-day-12/13479 "2025-12-14T12:51:54Z")

</div>

Main thread for Day 12 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has cha…

---

## [AoC 2025: Day 11](https://ziggit.dev/t/aoc-2025-day-11/13469)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 3\
**Last updated:** [December 11, 2025, 2:51pm UTC](https://ziggit.dev/t/aoc-2025-day-11/13469 "2025-12-11T14:51:32Z")

</div>

Main thread for Day 11 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has cha…

---

## [AoC 2025: Day 5](https://ziggit.dev/t/aoc-2025-day-5/13368)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 7\
**Last updated:** [December 11, 2025, 11:38am UTC](https://ziggit.dev/t/aoc-2025-day-5/13368 "2025-12-11T11:38:56Z")

</div>

Main thread for Day 5 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 1](https://ziggit.dev/t/aoc-2025-day-1/13296)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 10\
**Last updated:** [December 11, 2025, 11:24am UTC](https://ziggit.dev/t/aoc-2025-day-1/13296 "2025-12-11T11:24:57Z")

</div>

Main thread for Day 1 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 7](https://ziggit.dev/t/aoc-2025-day-7/13411)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 8\
**Last updated:** [December 10, 2025, 11:09am UTC](https://ziggit.dev/t/aoc-2025-day-7/13411 "2025-12-10T11:09:48Z")

</div>

Main thread for Day 7 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 6](https://ziggit.dev/t/aoc-2025-day-6/13396)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 4\
**Last updated:** [December 9, 2025, 11:18am UTC](https://ziggit.dev/t/aoc-2025-day-6/13396 "2025-12-09T11:18:25Z")

</div>

Main thread for Day 6 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 8](https://ziggit.dev/t/aoc-2025-day-8/13431)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 4\
**Last updated:** [December 9, 2025, 12:37am UTC](https://ziggit.dev/t/aoc-2025-day-8/13431 "2025-12-09T00:37:03Z")

</div>

Main thread for Day 8 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 3](https://ziggit.dev/t/aoc-2025-day-3/13332)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 8\
**Last updated:** [December 7, 2025, 9:25pm UTC](https://ziggit.dev/t/aoc-2025-day-3/13332 "2025-12-07T21:25:14Z")

</div>

Main thread for Day 3 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [AoC 2025: Day 2](https://ziggit.dev/t/aoc-2025-day-2/13307)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 8\
**Last updated:** [December 5, 2025, 1:56pm UTC](https://ziggit.dev/t/aoc-2025-day-2/13307 "2025-12-05T13:56:17Z")

</div>

Main thread for Day 2 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [Spot the bug](https://ziggit.dev/t/spot-the-bug/13364)

<div class="topic-metadata">

**Author:** [@jeffective](https://ziggit.dev/u/jeffective)\
**Replies:** 5\
**Last updated:** [December 5, 2025, 6:08am UTC](https://ziggit.dev/t/spot-the-bug/13364 "2025-12-05T06:08:46Z")

</div>

Bonus points if you can propose an alternative code structure that would prevent this type of bug in the future. /// Convert little endian packed bytes from EtherCAT to host representation. /// /// Supports enums, packe…

---

## [AoC 2025: Day 4](https://ziggit.dev/t/aoc-2025-day-4/13348)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 9\
**Last updated:** [December 4, 2025, 11:06pm UTC](https://ziggit.dev/t/aoc-2025-day-4/13348 "2025-12-04T23:06:03Z")

</div>

Main thread for Day 4 of the 2025 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Notice that Advent of Code has chan…

---

## [Improving HashMap using the recent paper](https://ziggit.dev/t/improving-hashmap-using-the-recent-paper/11998)

<div class="topic-metadata">

**Author:** [@igors84](https://ziggit.dev/u/igors84)\
**Replies:** 2\
**Last updated:** [September 11, 2025, 7:34pm UTC](https://ziggit.dev/t/improving-hashmap-using-the-recent-paper/11998 "2025-09-11T19:34:45Z")

</div>

So I stumbled upon this recent paper that explains how they found a way to make hashmaps much more performant than was previously thought possible. If I managed to get AI to correctly explain it the main revelation is th…

---

## [AoC 2024: Day 24](https://ziggit.dev/t/aoc-2024-day-24/7492)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 2\
**Last updated:** [December 29, 2024, 5:53pm UTC](https://ziggit.dev/t/aoc-2024-day-24/7492 "2024-12-29T17:53:44Z")

</div>

Happy Christmas Eve! Main thread for Day 24 of the 2024 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Some Rules: …

---

## [AoC 2024: Day 21](https://ziggit.dev/t/aoc-2024-day-21/7452)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 2\
**Last updated:** [February 19, 2025, 6:50am UTC](https://ziggit.dev/t/aoc-2024-day-21/7452 "2025-02-19T06:50:00Z")

</div>

Main thread for Day 21 of the 2024 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Some Rules: Please try to keep s…

---

## [AoC 2024: Day 6](https://ziggit.dev/t/aoc-2024-day-6/7183)

<div class="topic-metadata">

**Author:** [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Replies:** 11\
**Last updated:** [December 10, 2024, 5:57am UTC](https://ziggit.dev/t/aoc-2024-day-6/7183 "2024-12-10T05:57:16Z")

</div>

Main thread for Day 6 of the 2024 advent of code. Feel free to discuss the challenge and ask questions. If particular discussions become large, we can break them off into new threads. Some Rules: Please try to keep sp…

---

## [Making WasmAllocator thread-safe](https://ziggit.dev/t/making-wasmallocator-thread-safe/8344)

<div class="topic-metadata">

**Author:** [@chung-leong](https://ziggit.dev/u/chung-leong)\
**Replies:** 3\
**Last updated:** [February 3, 2025, 11:01pm UTC](https://ziggit.dev/t/making-wasmallocator-thread-safe/8344 "2025-02-03T23:01:56Z")

</div>

This is related to an earlier post. A few days ago, there was a commit to the ziglang repo that removed WasmPageAllocator. It also added a if (!builtin.single\_threaded) @compileError(...) to WasmAllocator. I look at the…

[Next page](https://ziggit.dev/c/challenge/11.md?page=1)
