logoalt Hacker News

lionkoryesterday at 9:05 AM9 repliesview on HN

Zig is a modern C,

Rust is a modern C++/OCaml

So if you enjoy C++, Rust is for you. If you enjoy C and wish it was more verbose and more modern, try Zig.


Replies

mgoetzkeyesterday at 11:44 AM

As someone who never liked writing anything C++ since 2000+ (did like it before) I cannot agree with this. C++ and Rust are not comparable in this sense at all.

One can argue Rust is what C++ wanted to be maybe. But C++ as it is now is anything but clean and clear.

show 2 replies
geonyesterday at 10:55 AM

Comparing Rust to C++ feels strange to me.

It’s like people do it just because Zig is very comparable to C. So the more complex Rust must be like something else that is also complex, right? And C++ is complex, so…

But that is a bit nonsensical. Rust isn’t very close to C++ at all.

show 1 reply
microtonalyesterday at 10:14 AM

It is kind of interesting that the Linux kernel is slowly adopting Rust, whereas Zig seems like it would be a more natural fit?

I know, timelines not matching up, etc.

show 5 replies
jodleifyesterday at 12:27 PM

I found swift way more enjoyable than rust as a C++ alternative. It even has first class-ish interop now.

apiyesterday at 11:00 AM

My take, unfortunately, is that Zig might be a more modern C but that gives us little we don’t already have.

Rust gives us memory safety by default and some awesome ML-ish type system features among other things, which are things we didn’t already have. Memory safety and almost totally automatic memory management with no runtime are big things too.

Go, meanwhile, is like a cleaner more modern Java with less baggage. You might also compare it to Python, but compiled.

show 1 reply
bayindirhyesterday at 9:28 AM

Seriously asking, where Go sits in this categorization?

show 3 replies
pjmlpyesterday at 12:46 PM

Zig is Modula-2/Object Pascal re-packaged with a C like syntax.

7bityesterday at 11:06 AM

C++ added OOP to C.

Rust is not object-oriented.

That makes your statement wrong.

show 2 replies
benobyesterday at 9:17 AM

Time to start zig++