Show HN: Zedis – A Redis clone I'm writing in Zig
46 points
3 hours ago
| 5 comments
| github.com
| HN
Writing Redis from scratch in Zig.
jasonjmcghee
12 minutes ago
[-]
I'm not really sure what it costs these days - i know certain projects not entirely free like they were a few years ago, but there's a pretty good "build your own redis" among other things.

It has little step-by-step tasks with automated tests. There are some other good ones like git and docker. It's pretty cool.

https://app.codecrafters.io/courses/redis/overview

reply
nine_k
40 seconds ago
[-]
It's easy to write a KV store, even a KV store with key expiration. But Redis is quite a bit more than that. Consider sharding and replication at least. Then lists, sets, zsets, bitfields, streams, geospatial indexes, hyperloglog / bloom filters, time series.

Something like LevelDB is relatively easy to write. Then you can build the rest of Redis on top of it.

reply
esafak
15 minutes ago
[-]
Consider adding support for vector search and sketching (https://www.sketchingbigdata.org/).
reply
johnisgood
1 hour ago
[-]
Seems like LLMs are getting good at Zig (with some help, I presume).
reply
mtlynch
1 hour ago
[-]
Is there anything about this project that seems LLM-generated?

I've found that LLMs are particularly bad at writing Zig because the language evolves quickly, so LLMs that are trained on Zig code from two years ago will write code that no longer compiles on modern Zig.

reply
jasonjmcghee
5 minutes ago
[-]
I skimmed, for me it was this: https://github.com/barddoo/zedis/blob/87321b04224b2e2e857b67...

There seems to be a fair amount of stigma around using llms. And many people that use them are uncomfortable talking about it.

It's a weird world. Depending on who is at the wheel, whether an llm is used _can_ make no difference.

But the problem is, you can have no idea what you're doing and make something that feels like it was carefully hand-crafted by someone - a really great project - but there are hidden things or outright lies about functionality, often to the surprise of the author. Like, they weren't trying to mislead, just didn't take them time to see if it did all of what the LLM said it did.

reply
5-
1 hour ago
[-]
https://github.com/barddoo/zedis/blob/87321b04224b2e2e857b67...

these seem to occur only in college assignment projects, and in the output of text generators trained on those.

reply
nine_k
21 minutes ago
[-]
Has been doing this for years, even before LLMs were a thing. No, not in college assignments; by the time emoji appeared, I had long since walked out of my PhD program and went to the industry.

I put such emojis at the beginning of big headings, because my eyes detect compact shapes and colors faster than entire words and sentences. This helps me (and hopefully others) locate the right section easier.

In Slack, I put large emojis at the beginning of messages that need to stand out. These are few, and emojis work well in this capacity.

(Disclaimer: I may contain a large language model of some kind, but very definitely I cannot be reduced to it in any area of my activity.)

reply
adastra22
18 minutes ago
[-]
FWIW it is really confusing to me and others. What is this emoji supposed to mean? Heck if I know.

But the telltale signs are far more than just that. The whole document is exactly the kind of README produced by Claude.

reply
WD-42
59 minutes ago
[-]
I will never place emojis in any of my readmes ever again.
reply
chucky_z
58 minutes ago
[-]
spell out 'development' with hammer emojis. bring ascii art back as emoji art.

(i actually do this in slack messages and folks find it funny and annoying, but more funny)

reply
tayo42
55 minutes ago
[-]
People were doing this before llms, otherwise how did they learn it?
reply
adastra22
17 minutes ago
[-]
That's why he said "never again"
reply
WD-42
46 minutes ago
[-]
Sure, but llms absolutely love to do it for some reason.
reply
tayo42
1 minute ago
[-]
I just took a look at a Readme I had cursor write a couple months ago and there's no emojis
reply
rmonvfer
54 minutes ago
[-]
As an avid Claude Code user, I can tell you with 99% probability, that README is LLM-generated. This exactly the same structure and wording used by Claude (of course, it has some human modification because otherwise I’d filled with emojis)

In my experience, when you work with something like agentic development tools, you describe your goals and give it some constraints like “use modern zig”, “always run tests”… and when you ask it to write a README, it will usually reproduce those constraints more or less verbatim.

The same thing happens with the features section, it reads like instructions for an LLM.

I might be wrong but I spend way too much time using Claude, Gemini, Codex… and IMHO it’s pretty obvious.

But hey, I don’t think it’s a problem! I write a lot of code using LLMs, mostly for learning (and… ejem, some of it might end up in production) and I’ve always found them great tools for learning (supposing you use the appropriate context engineering and make sure the agent has access to updated docs and all of that). For example, I wanted to learn Rust so I half-vibed a GPUI-based chat client for LLMs that works just fine and surprisingly enough, I actually learned and even had some fun.

reply
adastra22
16 minutes ago
[-]
I don't know why you're being downvoted. This follows the LLM-generated-README template perfectly. And yeah, it usually ends up being a dumping ground for the constraints you gave it, almost verbatim.
reply
barddoo
38 minutes ago
[-]
Oh that’s nice of you. I take that as a compliment.
reply
pdntspa
1 hour ago
[-]
Is zig lang stable enough now to start basing real projects on it?
reply
pyrolistical
36 minutes ago
[-]
Depends on your definition of stable. I would suspect most people would consider it unstable as they are still breaking the API for async. Wait for 1.0 if you really need true stability. But zig is just so good not to use now
reply
tonyhart7
43 minutes ago
[-]
"Is zig lang stable enough now to start basing real projects on it?"

only if you want to refactor/rewrite a lot

reply
justinhj
1 hour ago
[-]
Check out Tigerbeetle and Ghostty
reply
jrpelkonen
1 hour ago
[-]
Also bun
reply
fishmicrowaver
59 minutes ago
[-]
I mean no offense but a billionaires vanity terminal and a database with an anime bug mascot are a bit different than a redis alternative
reply
rvrb
1 minute ago
[-]
Good point, the database written in Zig with a bug mascot tells us nothing about writing a database in Zig without a bug mascot
reply
dpatterbee
45 minutes ago
[-]
Is software not real software if it's written by a billionaire? What is it about the bug mascot that detracts from the database's legitimacy?
reply
aschobel
30 minutes ago
[-]
bun is real and spectacular. super loving using it
reply
tcfhgj
1 hour ago
[-]
So riiR is now riiZ? ;)
reply
nine_k
11 minutes ago
[-]
"Rewrite it away from C (or C++)". Whether you choose Rust, Zig, Ada, D, Nim, even Pascal, it's likely going to become more secure. It will be supported on fewer platforms though, but still should run fine under Linux, macOS, Windows, *BSD, on x64, Arm64, and likely RISC-V, too.
reply