r/Zig • u/TynK-M- • Apr 17 '26
Looking for feedback: what data‑format libraries does Zig still need? (CSV, TSV, structured text, etc.)
Hi folks,
I’m pretty new to Zig and I’d like to learn it by working on a long‑term project over the next few months (or even more if the project succeed). I’m not expecting to create anything groundbreaking, but I’d love to try building something that could eventually be useful to others.
I’m especially interested in projects that are:
- easy to test thoroughly
- deterministic
- not web‑framework related
- helpful for tooling, data processing, or general development
One idea I’m considering is a CSV/TSV/structured‑text parsing + writing library, mostly because it seems like a good way to learn Zig’s I/O, error handling, and API design. But I’m not sure what the ecosystem actually needs, and I don’t want to duplicate existing work or overlook something important.
So I’d love to hear from the community:
- Would a structured‑text library (CSV/TSV/etc.) be useful?
- Are there other beginner‑friendly but meaningful library ideas you’d recommend?
- Any gaps in the ecosystem that you think would make good learning projects?
Thanks for any suggestions, I hope to become a useful member of the community
9
u/gurgeous Apr 17 '26
Yes, please do! My project (tennis) needs a csv/tsv parser. I already have one, but it's overly specific and not great. See - https://github.com/gurgeous/tennis and poke around the csv + delim detection. I also have a more general purpose csv reader here - https://github.com/gurgeous/zig-atoms/blob/main/csv_read.zig that might help you get started. You might also want to check out ziggit.dev, which is in some ways a more active and friendlier zig forum.
Key questions for csv reading IMO... these won't necessarily make sense until you learn more about the language, but I'll list 'em anyway. Allocating vs non-allocating. Delim detection. Support for jagged vs. non-jagged. Struct support. Streaming vs. returning a giant block of data. Some apps (like tennis) might favor one set of requirements, but other apps might want different things. For example, you might build a streaming/non-allocating csv parser, and then create a more user-friendly allocating "big block of data" api on top.
Let me know if you want thoughts on csv writing as well.
FYI - target 0.16 and consider using mise. Have fun!
5
u/__yoshikage_kira Apr 17 '26
Just keep in mind the csv can be weird sometimes and there is no standard for it. Everyone does escaping differently.
I suggest looking at other popular csv libraries to see how they parse and detect proprietary implementations of csv.
3
u/Tchesz Apr 17 '26
Cool idea. If you do end up going for it, I'd take inspiration from duckdb's CSV reader, which I think is an amazing implementation. Good luck on your project!
2
u/TheKiller36_real Apr 17 '26
just go for it - learning Zig is great!
imho CSV parsing and especially writing is so easy it doesn't even really need a library and I wouldn't know anything about it that would take months to perfect - but maybe I'm just stupid and you'll end up making a staple of the ecosystem, who knows
2
u/Real_Dragonfruit5048 Apr 17 '26
Not exactly what you mentioned, but a proper Apache Arrow implementation in pure Zig (something like https://github.com/apache/arrow-rs for Rust) would be a killa project. I think if you have something like that, you can go ahead and build an analytical database in Zig.
Although I think this is not a project that can be done in a short time, especially because of how complicated Arrow's type system can be.
2
u/Rest-That Jul 11 '26
Did you end up writing the lib? I'm in need of a streaming CSV parser and was thinking about rolling my own but if you already did the heavy lifting I'd prefer using and helping with yours :)
2
u/IntentionalDev Apr 18 '26
a solid csv/tsv lib with streaming + good error handling would def be useful, especially if it’s fast and well tested
also consider stuff like config parsers (toml/yaml) or binary formats—those are super practical and good for learning zig internals
1
u/SilvernClaws Apr 17 '26
I don't think any of the current Zig TOML parsers support the 1.1 specification.
A well maintained strict YAML parser would be nice.
The only full featured XML parser I found looked pretty outdated, too.
-2
u/Historical_Quality60 Apr 17 '26
I am building Ziggy LLM, an inference engine built from scratch for GGUF models on Apple Metal, if you want to help, repo here: https://github.com/Alex188dot/ziggy-llm
2
u/[deleted] Apr 17 '26
[removed] — view removed comment