"All it took was some basic understanding of memory management and a bit of discipline." The words of every C programmer who created a CVE.
Zig feels more practical than Rust for real-world CLI tools
11–20 of 412 posts
Re: Zig feels more practical than Rust for real-world CLI tools
#12[flagged]
However, 3 months ago me was clearly an idiot judging from the utter crap he wrote. Me in 3 months is also an idiot, he won’t get the greatness of these genius hacks I’m making.
Re: Zig feels more practical than Rust for real-world CLI tools
#13"All it took was some basic understanding of memory management and a bit of discipline." The words of every C programmer who created a CVE.
Re: Zig feels more practical than Rust for real-world CLI tools
#14What are your thoughts on nim, odin and v-lang, D-lang? I feel like I am most interested about nim given how easy it was to pick up and how interoperable it is with C and it has a garbage collector and can change it which seems to be great for someone like me who doesn't want to worry about manual memory management right now but maybe if it becomes a bottleneck later, I can atleast fix it without worrying too much..
Out of all of them from what little I know and my very superficial knowledge Odin seems the most appealing to me, it's primary use case from what I know is game development I feel like that could easily pivot into native desktop application development was tempted to make a couple of those in odin in the past but never found the time.
Nim I like the concept and the idea of but the python-like syntax just irks me. haha I can't seem to get into languages where indentation replaces brackets.
But the GC part of it is pretty neat, have you checked Go yet?
Re: Zig feels more practical than Rust for real-world CLI tools
#15Re: Zig feels more practical than Rust for real-world CLI tools
#16As far as my understanding of zig goes....it can compile into C....so if you really want secure C code you can compile zig into C?
Not quite, it can translate C into zig using the `translate-c` command that it comes with. But it compiles directly into machine code
Re: Zig feels more practical than Rust for real-world CLI tools
#17As far as my understanding of zig goes....it can compile into C....so if you really want secure C code you can compile zig into C?
Re: Zig feels more practical than Rust for real-world CLI tools
#18"All it took was some basic understanding of memory management and a bit of discipline." The words of every C programmer who created a CVE.
All jokes aside, it doesn’t actually take much discipline to write a small utility that stays memory safe. If you keep allocations simple, check your returns, and clean up properly, you can avoid most pitfalls. The real challenge shows up when the code grows, when inputs are hostile, or when the software has to run for years under every possible edge case. That’s where “just be careful” stops working, and why tools, fuzzing, and safer languages exist.
Re: Zig feels more practical than Rust for real-world CLI tools
#19IMO, as a C++ developer, Swift makes the most sense to me if I were looking for a safer alternative. I think people prefer what's familiar to them, and Swift definitely looks closer to existing C++ to me, and I believe has multiple people from the C++ WG working on it now as well, supposedly after getting fed up with the lack of language progress on C++. The most recent versions gained a lot in the way of cross-platf…
Re: Zig feels more practical than Rust for real-world CLI tools
#20Earlier quoted context omitted.
Not quite, it can translate C into zig using the `translate-c` command that it comes with. But it compiles directly into machine code
There is a C backend, so you can also compile Zig into C if you want.