Re:When Zig is safer and faster than Rust
by coliveira on Tuesday March 07, 2023 @01:39PM
(#35059254)
Agreed, using Rust is like switching a monster (C++) for another even worse. And notice that Rust is not even a mature language, it will get much worse. I will stay with C, thank you.
[ Parent
| on HN ]
Re:When Zig is safer and faster than Rust
by ok123456 on Tuesday March 07, 2023 @01:57PM
(#35059536)
'constexpr' and 'auto' in modern C++ can eliminate a large portion of the ugliness. In some cases it can be much more ergonomic than the equivalent Rust.
Indeed, one gets to write macro like code on the same language.
You can write Rust macros in Rust if you wish to do so, but it's a bit more involved (https://doc.rust-lang.org/reference/procedural-macros.html), btw
Rust also has const generics (but they are still a bit shabby in places last time I used them).
I for one never liked the constexpr semantic and syntax. Always felt like a... Little pebble in my shoe. Didn't quite annoy me enough not to use it since it was useful, but it was never a comfortable experience.
Re:When Zig is safer and faster than Rust
by DeathArrow on Tuesday March 07, 2023 @02:09PM
(#35059722)
At least C++ is enormous and you can find a sane subset that you enjoy using. And C++ can be pretty safe with smart pointers.
Unfortunately there is always that clever one than can't let go of writing C style code, regardless of what kind of pointers are being used.
It is one of my favourite languages, but I also acknowledge that C compatibility is a big pain point for security.
This almost works until you have to integrate with other people's C++ code and find out they picked a different subset to you.
Can you write a performant, generic vector data structure in C? Until then it is useless in my book.
Re:When Zig is safer and faster than Rust
by coliveira on Tuesday March 07, 2023 @11:20PM
(#35065210)
So useless that Linux, gcc, and all UNIX system commands is written in C. But you're probably doing much more important things, right?
Re:When Zig is safer and faster than Rust
by heldrida on Wednesday March 08, 2023 @04:25AM
(#35066925)
We should definitely appreciate the craftsmanship. This comment says everything, regardless of how trendy Rust might be, let’s respect the craft, your favourite language doesn’t make you more important. Legends!
Rust is not my favorite language and I didn’t mean to speak anything negative about projects written in C, but I do think that those that become great did so in spite of C, not because of it.
No access to performant generic data structures is a major reason why truly performance oriented programs rather choose C++ over C.