5 ms·
Things I like about Zig as a Go Programmer
- andrewfromx 3y agozig does seem like a much more reasonable c/c++ replacement than rust.
- frankjr 3y agoAgreed. It even brings all of the use after frees, memory overflows, data races etc. along so C/C++ programmers will feel right at home!
- b5n 3y agoAnd we'll keep building the systems that power the world so you can continue to feel right at home. You're welcome!
- FFP999 3y agoSo life critical software will continue to have completely avoidable bugs in it, got it.
- sitzkrieg 3y agoit is possible to write bug free code in many compiled languages
- waych 3y agoBut nobody does?
- FFP999 3y agoIt's a job security thing. Otherwise you deliver the perfect program and then there's no need for you anymore.
- iris2004 3y ago[dead]
- FFP999 3y agoThis is just simply not so, or at best, the odds of writing a nontrivial bug free program in any language are negligible. Also, we are talking specifically of C, C++, and Zig here. Three compiled languages among hundreds.
- karmakaze 3y agoOnly if your name is Knuth--put your money where your mouth is.
- sitzkrieg 3y agoi enjoyed this laugh, thank you
- deleted 3y ago[deleted]
- tapirl 3y agoYes, Zig is friendly to C/C++ programmers. This is a big advantage of Zig.
- actuallyalys 3y agoThe distinction I’ve heard is that Zig is a “better C” and Rust is a “better C++.” I haven’t done a lot of programming in any of these languages, but as an outsider it certainly seems apt.
- sshine 3y agoThese can be true, while at the same time, “Rust is a better C.” Zig and Rust have a lot of the same and a lot of different stuff to offer. I drank the Rust koolaid, but I thought for a long time Zig or Nim would be the most popular C alternative. It’s all about the macros, it seems. Rust’s macros are not the best in the world, but they are really good.
- tapirl 3y agoThat's not a good analogy. Zig shares much blood with C, but Rust doesn't share much blood with C++. Though, from the complexity view, Rust can be viewed as another C++ (or C+++).
- fleventynine 3y agoThere's a lot to like about Zig, especially related to metaprogramming. Unfortunately, bulletproof memory safety is table stakes for a modern language. Without a garbage collector or borrow checker, Zig is DOA for any use case that involves untrusted data. Maybe there's a few niches (single player games?) that don't need memory safety...
- TUSF 3y agoYou can always use a garbage collecting allocator with Zig, if you're that paranoid anout it.
- pjmlp 3y agoFor that better use D, Nim, Swift, C#, Go, designed from the ground up with one in mind, and whole ecosystem counts on it, instead of having coloured libraries.
- TUSF 3y agoBy convention, all Zig libraries have functions that take an allocator as input from the user. Your application can use libgc[1] and pass the allocator to any library function you use, and not worry about deallocating afterwards. [0]: https://github.com/linusg/zig-libgc https://github.com/linusg/zig-libgc
- rowanG077 3y agoReasonable and memory unsafe. Pick one.
- pjmlp 3y agoWhile it offers Modula-2 like safety, with a syntax more appealing to C developers, in the 21st century we expect a little more from a systems language.
- __loam 3y agoI love both these languages
- sshine 3y agoYou know, that's not allowed in some states.
- pdimitar 3y agoI appreciate and respect the "love it!" factor that Zig brings to the table. At the same time, IMO we shouldn't allow infatuation override the hard-learned lessons of our area. Rust can be a drag but when we're talking compiling to machine code, I'll still prefer it to any other language that does not offer memory safety enforced by the compiler. Furthermore, Zig is still changing, and the pace with which it is improved doesn't give me much hope. I'm open to have my mind changed so I'm observing from the sidelines. It might turn out to be the best of everything but at least to me it's too early to tell.
- EdwardDiego 3y agoThe article didn't mention Rust at all. Why do you?
- pdimitar 3y agoWhy are you asking? I was tempted to mention a few more but figured I don't want to make the comment too long.
- karmakaze 3y agoThe thing that's great about Zig is that it's compiled languages deconstructed. It makes us realize the things that get conflated in other languages and lets us mix-n-match as a matter of course.