[Nottingham] Opinions about Zig
martin at stupids.org
martin at stupids.org
Mon Feb 5 19:45:03 UTC 2024
On Mon, Jan 29, 2024 at 10:57:35AM +0000, Dennis Furr via Nottingham wrote:
> I just want to see how many within our community are aware of Zig and to
> get opinions about whether this is worth learning. Having built my career
> around SysOps and DevOps, it might be fun to learn a low-level language but
> C appears to me to be as approachable as ASM.
I don't have experience in Zig specifically, but I've been following the
minor explosion in "better C" language attempts for quite a while. (Zig,
Nim, Rust, Hare, probably more I've forgotten)
I think the interesting thing is they are all trying to retain some of
the advantages of C (fast, low level, flexible) while reducing some of the
downsides (too easy to have buffer overflows, tedious memory
management, etc), but they all go about it in different ways.
Zig is next on my list to write something experimental in. I like the
idea of how memory allocators are handled.
If you are looking for a low level language other than C, I must say my
personal favourite is Rust.
It's already now a second language accepted in Linux as well as C, and
is making major inroads in the open source desktop world, for example various
parts of gnome are starting to be written or rewritten in Rust, as well as many
things like mesa drivers, video codecs and other low level things that
need to be fast. It's also being increasinly adopted by major tech
companies if that's something you care about.
Most of all, it makes it easy to write code that is safe _and_ fast. I have
to admit, whenever I tried to do anything non-trivial in C many years ago,
I always ended up spending much more time on debugging segfaults and race
conditions than I did on adding features. Rust fixes that for me.
I have to admit though, it has a steep learning curve compared to every
other language I've tried to learn (including C), but once it "clicked", I was
totally hooked.
Martin.
More information about the Nottingham
mailing list