8 ms·
Good sign for the language, bad sign for HN. I totally get it's nicer than C, I love it too, but it's completely irresponsible to push a language without a mem
by refulgentis 4y ago
Good sign for the language, bad sign for HN.
I totally get it's nicer than C, I love it too, but it's completely irresponsible to push a language without a memory safety story, in 2022, this hard.
From that relatively obvious conclusion it devolves into tedious nerdsnipes. Yes there are edge cases.
- skohan 4y agoThat's a rather extreme position.
- pcwalton 4y agoIt's not an extreme position. Most languages in wide use, and virtually all new languages, are memory safe. Zig is an extreme outlier in this regard.
- skohan 4y agoThat's extremely hyperbolic. Zig is a systems programming language with an explicit goal of operating at a low level of abstraction. Virtually all languages in its class are less memory safe than Zig.
- pcwalton 4y agoExcept Rust? We can't ignore the fact that Rust has shown that memory safety is not incompatible with low-level semantics. (Of course, Ada, Cyclone, CCured, etc. showed this much earlier than Rust.)
- skohan 4y agoZig has very different goals than Rust. The explicit theory of the language is that Rust's approach to memory safety creates costly tradeoffs which are not needed for all use-cases. It is very much not the consensus that memory safety is a requirement for any modern language. Asserting that it should be a requirement is an extreme position.
- refulgentis 4y ago"Virtually" is where your argument falls apart, and I want to be clear I'm not just dunking and moving on, I do understand the position that _not_ using a memory safe language is irresponsible is fairly new.
- skohan 4y agoThat position is not only new, it's also not the consensus. Zig explicitly chooses to make memory safety a non-goal of the language, with the argument that Rust-style memory safety is a costly tradeoff which is not always justified. Assuming that my argument has "fallen apart", or that you have "dunked" seems quite absurd given that you've taken an extreme position which many serious practitioners and academics would disagree with.
- pcwalton 4y agoThe point is that Zig's choice around memory safety makes its language design principles significantly outside the consensus around what PL design should be.
- skohan 4y agoAccording to who? It's absolutely not the consensus that every programming language needs to prioritize safety. Rust is still very much an experiment in terms of systems programming. It has a tiny overall "market share" in terms of use in large production projects compared to C/C++ and it remains to be seen whether the particular set of tradeoffs chosen by the language will lead to long term sustainable success. Zig takes another approach and is also a worthy experiment.
- pcwalton 4y agoRust is serving billions of users right now. It's far past the "experiment" stage and has proven itself.
- 4y ago
- pron 4y agoZig has a pretty good memory safety story -- and more generally, a correctness story -- it's just a different story from Rust's. I find it funny that fans of a language of a not-so-young-age that is struggling to find relevance and capture even 1% of the market are treating it as such an inevitability that it's irresponsible to talk about anything else. It's also detached from reality, as much of the software we all depend on is being written, in 2022, in languages without sound memory safety guarantees. There are various approaches being tried for how we should write low-level programs in the future, but there is no consensus yet on the best one.
- pcwalton 4y ago> Zig has a pretty good memory safety story No, Zig is simply not memory safe. That's a property of a programming language that has a definition. Zig does not meet that definition. > I find it funny that fans of a language of a not-so-young-age that is struggling to find relevance and capture even 1% of the market are treating it as such an inevitability that it's irresponsible to talk about anything else. Leaving aside your weird description of a language powering software that serves billions of users as "struggling to find relevance", most software in 2022 is written in languages that are memory safe. Zig is quite the outlier here. It would in fact be very reasonable to survey the landscape of popular languages today and come to the conclusion that memory safety is an inevitability. > It's also detached from reality, as much of the software we all depend on is being written, in 2022, in languages without sound memory safety guarantees. Virtually all of that software is being developed in C or C++. The most compelling reason to use those languages is that they have a huge install base and a huge amount of code already written in them. This says nothing about whether a brand-new language should be memory safe. > There are various approaches being tried for how we should write low-level programs in the future, but there is no consensus yet on the best one. No, there actually is PL consensus that all new languages should be memory-safe, maybe aside from very low-level specialized languages, which Zig is not trying to be--Zig is trying to be a general purpose language.
- pron 4y ago> No, Zig is simply not memory safe. I didn't claim that it is. I said it has a good memory safety story, i.e. mechanisms that soundly guarantee some kinds of memory safety, plus a design that helps write correct programs. Correctness in general, and memory safety in particular, are very central concerns in Zig's design, it's just that its story isn't one of sound guarantees across the board but, rather, some balanced mix of approaches -- some based on soundness, others based on facilitating comprehension and easier testing. > Most software in 2022 is written in languages that are memory safe. Zig is quite the outlier here. No, Zig is a low-level language, and the vast majority of low-level programs in 2022 are written in languages whose memory-safety story is worse than Zig's. > This says nothing about whether a brand-new language should be memory safe. That's right. We don't yet have an answer to that question, because we don't yet have sufficient experience with low-level languages that do have sound memory safety guarantees. I mean, it sure is better to have more guarantees if they come for free, but there's no such option in front of us just yet. > No, there actually is PL consensus that all new languages should be memory-safe No, there really isn't one when it comes to low-level languages (and the interest in Zig is proof that there is no consensus that it shouldn't exist). Rust is a low level language with sound memory safety guarantees, which comes at a price that makes it unappealing for some, and so various other approaches are being tried as well. You can't insist there's consensus when clearly there are people who disagree with you. That's the definition of a lack of consensus. I also think it is premature, to say the least, to declare an approach that is currently still far from proving a success as the only way.