3 ms·
Yep and like I said, I'm interested in Zig. But it's still somewhat discouraging as a C replacement just because it seems to still have all the same problems b
by VWWHFSfQ 1y ago
Yep and like I said, I'm interested in Zig. But it's still somewhat discouraging as a C replacement just because it seems to still have all the same problems but without the decades of tools and static analyzers to help out. But I'm keeping an eye on it.
- stratts 1y agoWhat's the state of the art here? Most of Zig's safety, or lack thereof, seems inherent to allowing manual memory management, and at least comparable to its "C replacement" peers (Odin, C3, etc).
- ArtixFox 1y agoI guess formal verification tools? That is the peak that even rust is trying to reach with creusot and friends. Ada has support for it using Spark subset [which can use why3 or have you write the proofs in coq] Frama-C exists for C. Astree exists for C++ but i dont think lone developers can access it. But it is used in Boeing.
- pjmlp 1y agoComparable to Modula-2 and Object Pascal, hence why those languages ought to do better. Otherwise it is like getting Modula-2 from 1978, but with C like syntax, because curly bracket must be.
- ArtixFox 1y agoIm pretty sure valgrind and friends can be used in zig. Zig is still not 1.0, theres not much stability guarantees, making something like Frama-C, even tho it is possible is simply going to be soo much pain due to constant breakages as compared to something like C. But it is not impossible and there have been demos of refinement type checkers https://github.com/ityonemo/clr https://github.com/ityonemo/clr Beyond that, tools like antithesis https://antithesis.com/ https://antithesis.com/ exist that can be used for checking bugs. [ I dont have any experience with it. ]
- garbagepatch 1y agoNo shame in waiting until 1.0. There's other production ready languages you can use right now so you can ignore Zig until then.
- Retro_Dev 1y agoIt is my opinion that even if Zig were nothing more than a syntactical tweak of C, it would be preferable over C. C has a lot of legacy cruft that can't go away, and decades of software built with poor practices and habits. The status-quo in Zig is evolving to help mitigate these issues. One obvious example that sets Zig apart from C is error handling built into the language itself.
- uecker 1y agoWhat specific legacy cruft does bother you? I think it is a strength of C that it evolves it slowly and code from decades ago will still run. I also do not see how having decades of legacy software is holding anybody back doing new stuff in C in a better way. New C code can be very nice.
- pjmlp 1y agoSo slowly that what allowed for Morris worm is still present in C23, and now everyone is rushing into hardware memory tagging as a solution instead.
- uecker 1y agoCan you be more precise? Memory safety does not only affect C programs and - despite people repeating this over and over - I do not believe it is true that it is actually harder to build safe programs in C compared to many other languages. Ada and Rust have certainly some advantage, but I think also this is exaggerated.
- pjmlp 1y agoMemory corruption caused by lack of bounds checking, or vocabulary types like the ones provided by SDS and glib. Microsoft had to come up with SAL during Windows XP SP2, Apple with -fbounds-safety alongside Safe C dialect for iBoot firmware, Oracle with ADI on Solaris/SPARC, Apple's ARM PAC extension, ARM and Microsoft's collaboration on Pluton and CHERI Morello, Apple, Microsoft, Google and Samsung's collaboration on ARM's MTE. Lots of money being spent on R&D, for something WG14 considers exaggerated.