Earlier quoted context omitted.
Seatbelt laws are still wrong, government has no business protecting me from myself. But even from an utilitarian perspective, compilers do have warnings and they could just have used that.
It also protects innocent bystanders from being forced to see your horrifyingly mangled body tossed on the ground in front of them in what could otherwise have either been a crash with no injuries, minimized injuries, or at least contained injuries. Do you still think that law is overstep, if so why? Genuine question, I have no horse in this race and am on the fence myself.
Zig: A new direction for low-level programming?
51–60 of 110 posts
Re: Zig: A new direction for low-level programming?
#52Earlier quoted context omitted.
This is the exact same attitude as people who threw tantrums about seatbelt laws in the 90s. It was wrong then, and it's wrong now. For mostly the same reasons.
Seatbelt laws are still wrong, government has no business protecting me from myself. But even from an utilitarian perspective, compilers do have warnings and they could just have used that.
If there are multiple people in a car and some choose to wear seatbelts and some choose not to, those who are not wearing seatbelts become a danger to everyone else as their bodies become in-vehicle projectiles.
Sure, I can understand the debate when it's just a single person in a car. But when a person's decision starts impacting others the debate is going to be very hard to win.
Re: Zig: A new direction for low-level programming?
#53I've been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai. Zig is one of the strong contenders, but Odin is IMO following a saner path, Carbon and D should be mentioned and I think there are a few others. My initial reaction to new programming languages is naturally skeptical, but I really liked the way the designers behind those efforts appr…
The lack of safety is not painful enough? There is an entire industry (i.e. job sector, training, expertise) that evolved to try to thwart bad actors abusing unsafe languages.
Re: Zig: A new direction for low-level programming?
#54> Of course, if you don’t use pos, the compiler will say that this is an error and refuse to compile as well. And if you discard that error (typically using _ = pos;), the compiler will complain that it should be a const. This was one of the main things that bothered me about Zig when I last tried it. This actively works against me when writing prototypes, exploratory code, and especially when writing code to learn t…
Re: Zig: A new direction for low-level programming?
#55Re: Zig: A new direction for low-level programming?
#56Earlier quoted context omitted.
Urgh this frustrates me so much. The worst part is, the recommended way to avoid these compilation problems is to add: _ = my_unused_variable; to your code. Some IDE extensions even do this automatically. But if you do that, it permanently suppresses all compiler feedback that my variable is unused! Its basically the worst of all worlds: - I can't easily prototype, or test code as I go because I keep stubbing my toe…
> (I have to do more work to test my code) I feel like that's already the cultural precedence in Zig. I mean, isn't their primary way of making sure your code fully and oncely frees all memory, just writing tons of tests that thoroughly exercise your function(s)?
The problem is that zig makes it hard to run the first half of a function or block of code. I've always got variables or parameters that I simply haven't put to use yet.
In an ideal world, my half-written code would fit neatly into a set of well defined functions with no unused variables. But at an experimental stage, I haven't refactored my code to make it beautiful yet. I always prefer to debug my code before refactoring it, because if my tests fail afterwards, I can isolate the bug to the refactoring process itself.
Re: Zig: A new direction for low-level programming?
#57I've been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai. Zig is one of the strong contenders, but Odin is IMO following a saner path, Carbon and D should be mentioned and I think there are a few others. My initial reaction to new programming languages is naturally skeptical, but I really liked the way the designers behind those efforts appr…
Re: Zig: A new direction for low-level programming?
#58I've been closely following and evaluating the train of C replacement languages that was (I believe) started by Jonathan Blow and Jai. Zig is one of the strong contenders, but Odin is IMO following a saner path, Carbon and D should be mentioned and I think there are a few others. My initial reaction to new programming languages is naturally skeptical, but I really liked the way the designers behind those efforts appr…
I feel many of your sentiments, and suspect that many C successors fail, because they don't want to just look like an evolution of C in the same way C with Classes did. No one is out here building C with Safety.
Re: Zig: A new direction for low-level programming?
#59Re: Zig: A new direction for low-level programming?
#60Earlier quoted context omitted.
Rust is a bit different, more like a C++ replacement and heavily focused on so-called memory safety, but with IMO many bad design decisions, while I consider Zig/Jai/Odin as merely "meh" I think that Rust is bad.
What about Rust's memory safety story justifies the "so-called" qualifier?
This should be called hardening and the whole "unsafe" thing is also detrimental. Computer security and exploits is a highly complex topic, there are no silver bullets. Rust code is safer to some extent, but not "safe" from bugs and exploits.