← Înapoi la Urmăritori

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 20
  1. A while ago, we looked at ArenaAllocators and why you should view their free as a noop.

  2. If I told you that the following prints 1665: var b: std.ArrayList(u8) = try .initCapacity(init.gpa, 1024); try b.appendSlice(init.gpa, "a" ** 1025); std.debug.print("{d}\n", .

  3. On AI

    I use AI (Claude Code).

  4. Is Zig's New Writer Unsafe?

    If we wanted to write a function that takes one of Zig's new *std.Io.Reader and write it to stdout, we might start with something like: fn output(r: *std.Io.Reader) !

  5. Everything is a []u8

    If you're coming to Zig from a more hand-holding language, one of the things worth exploring is the relationship between the compiler and memory.

  6. You might have heard that Zig 0.15 introduces a new IO interface, with the focus for this release being the new std.Io.Reader and std.Io.Writer types.

  7. Zig's new Writer

    As you might have heard, Zig's Io namespace is being reworked.

  8. In a recent, post-Zig 0.14 commit, Zig's SinglyLinkedList and DoublyLinkedList saw significant changes.

  9. Allocator.resize

    There are four important methods on Zig's std.mem.Allocator interface that Zig developers must be comfortable with: alloc(T, n) - which creates an array of n items of type T, free(ptr) - which frees memory allocate with alloc (although, this is implementa…

  10. What happens when you free with an ArenaAllocator?

  11. Maybe I'm the only one, but it always takes my little brain a split second to understand what's happening whenever I see, or have to write, something like value.* = .{...}.

  12. GetOrPut With String Keys

    I've previously blogged about how much I like Zig's getOrPut hashmap method.

  13. In the last blog posts, we looked at different ways to compare strings in Zig.

  14. Switching on Strings in Zig

    Newcomers to Zig will quickly learn that you can't switch on a string (i.e. []const u8).

  15. I have an unapologetic and, I'd like to think, pragmatic take on testing.

  16. In Zig, What's a Writer?

    As of mid-July 2025, development on a new Io namespace is underway.

  17. One of the first Zig-related blog posts I wrote was an overview of SIMD with Zig.

  18. Zig doesn't have an interface keyword or some simple way to create interfaces.

  19. Comptime as Configuration

    If you look at my httpz library, you'll notice that httpz.Server(T) is a generic.

  20. Zig's @bitCast

    In an older post, we explored Zig's @ptrCast and then looked at a concrete usage in the shape of std.heap.MemoryPool.