←back to thread

135 points barddoo | 1 comments | | HN request time: 0s | source

Writing Redis from scratch in Zig.
Show context
tcfhgj ◴[] No.45308065[source]
So riiR is now riiZ? ;)
replies(1): >>45308745 #
nine_k ◴[] No.45308745[source]
"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.
replies(1): >>45309389 #
maleldil ◴[] No.45309389[source]
Zig isn't memory safe, though. It's safer than C or C++, but not much.
replies(2): >>45309760 #>>45309844 #
ashikns ◴[] No.45309760[source]
This is what I have struggled to understand about Zig. It seems pretty much like C in a mental model aspect - you are responsible for everything. It's slightly better than C, but C already runs on everything on the planet and can be made secure even if painfully so. So what niche is Zig aiming to fill?
replies(2): >>45309865 #>>45309942 #
1. barddoo ◴[] No.45309942[source]
Zig detects memory leaks pretty well when you build it using -Doptimize=Debug.