Complex JSON handling
ziggit.dev·2d
💾Binary Formats
Preview
Report Post

January 27, 2026, 7:30pm 1

Zig supports JSON serialization. How can this be used for complex real-world tasks?

I need to parse an object, which contains strings and arrays of strings. I have the idea to use a Zig struct for the object. For the strings I use slices of u8. But how can I use what for an array of strings? My first idea is to use std.ArrayList([] u8) but I’m not sure if that is what the authors of the stdlib intend me to use here. What is it?

tholmes January 27, 2026, 7:47pm 2

The Programming Without Pointers style comes to mind. Basically, have a std.ArrayList(u8), and then have something like a second std.ArrayList(u32) for the string lengths, or perhaps offsets. (Offsets can be good; to slice the items, you just use the of…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help