Hacker Newsnew | past | comments | ask | show | jobs | submit | zigger69's commentslogin

> Also: operator overloading is the spawn of Satan.

It is. And I'm glad Zig has none of that. `==` only works for primitives and you will never be confused.


Not sure that's a good idea. The concept of some types being special should not be something exposed to the user.


> I do think on a long enough timescale, programmers will eventually move to a "better" language. But in my opinion, that time scale exceeds the lifespan of a human :)

Zig exists and is here today.


Wow, that's amazing! I agree so much. When I want to know which of two products is better, I just want to see a casual reddit discussion with real people stating their opinions and knowledge. Discussions seems like a great feature! Brave Search is becoming more and more interesting.


It's really easy in Zig to be honest. Just put `defer thing.deinit()` in the right scope and you're done. You gain explicitness and know exactly what's going on in your Code. Everything is obvious. That's the reason Zig is so incredible simple and easy to read. Zig also has a GPA that will tell you about memory leaks or anything.


And in rust you just put `` in the right scope and you're done. This is perfectly explicit and you know exactly what's going on in your code. Everything is obvious.


You can execute arbitrary code on drop operations by implementing `std::ops::Drop` for a type.


A `.deinit()` function could also run some arbitrary code that does weird and unexpected things. The point is that reasonable people don't abuse functions like that — if they do abuse, don't use their code. Neither Rust nor Zig is a sandbox that could stop actively stupid/malicious code.


Rust's ownership rules are no less explicit. The object dies when the owner of the data goes out of scope.


Crystal: compilation speed is just too slow, sadly. Nim and Zig: I'd definitely just go with Zig. It's an extremely simple language, has no macros (but something much better than macros), is explicit, and in the long run it's just going to be worth it much more than Nim.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: