As somebody who’s fascinated by programming languages in general, I’m quite keen on Zig. I prefer Rust, and disagree with a bunch of things Zig does, but admire the language for trying.
I don't even think this is true.
You can certainly say "the security of computer systems would be a little bit better if most software was written in memory safe languages" (even more so if you went a bit further and said "with automatic memory management").
However, a lot of software exists and is useful, and the only reason it exists is because the author(s) found a way they liked to express that software.
So, for example, there are millions of companies out there, especially small ones, running all their finances on Excel. Not even accounting software. Excel. I am totally OK with this. I do not need all these companies to rewrite their Excel workflows into frontend applications backed by a relational database, even though that would be "better" in a lot of ways (more robust, easier to backup, easier to bring someone else onto...). Those little business owners understand Excel and build models and count numbers and they're happy with that. If some kind of edict compelled them to use something "proper" instead, they might not even go into business, and the world would lose whatever it is their business does.
The same thing goes for software and languages. Each language, whether it's F#, Haskell, Common Lisp, PHP, ... brings with it its own kinds of expressiveness and usefulness, and ecosystems of programmers and libraries/modules form around it. Some languages are a better "fit", sometimes for the problem domain, sometimes for the programmer's mind, sometimes for community building. It's difficult to compare any two languages because of this, and if you were to say "language X should not exist, all software written in X should've been written in language Y", you have to accept in your thought experiment that were that the case, their is likely a huge amount of software which would not exist just out of the people who made it not being happy about language Y and, if it were the only choice, would choose not to create the software they created in language X at all.
If a language's mental model doesn't mesh well with yours, that's in and of itself an ever-flowing fountain of bugs, and a legitimate reason not to use it. This isn't a valid excuse to not give unfamiliar languages an earnest try, but does justify different people reaching different conclusions afterwards.
The single most important part of the mental model for programming in Excel is precisely that it takes people who tell themselves they could never be programmers, and tricks them into believing they aren't really programming, so they're "allowed" to do it by themselves. It's an incredibly empowering piece of tech. Rust and Zig and Haskell and all the other languages that excite me personally can never hold a candle to that.
> Each language, whether it's F#, Haskell, Common Lisp, PHP, ... brings with it its own kinds of expressiveness and usefulness, and ecosystems of programmers and libraries/modules form around it.
Preaching to the choir :)
But all other things are not equal, are they? A vital piece of software written in C that has been battle-tested and optimized throughout its two, three, four decades or more of existence does not magically improve if it gets rewritten in Rust. Not only does that not make sense in theory, we've also seen it in reality with the issues with the coreutils rewrites.
You can make a solid argument that new software written completely from zero would be better served by being written in Rust than C. But the "just rewrite it bro" types are so incredibly obnoxious and out of step with reality.
And yes, coreutils is a great example of what I mean. The GNU project was always meant to be the basis for a production grade operating system. I mean, GNU Hello is just a hello world program, and its source weighs in at 707kB zipped (or 3.6MB unzipped). The purpose is having a trivial application that can serve as reference for all the standard practices of the GNU Project. No amount of writing things in Rust can replace the engineering mentality that leads to GNU Hello existing. In comparison, as I understand it uutils was first and foremost an educational project that got coopted into being used in production. Things are very much not alike here.
Almost all HN software related discussion will have some Rust folks saying 'yeah I have a rust project for that', or 'just write this in rust and it will be better', so annoying after seeing those each time, it's like the house-window sales guy keeps knocking my door every day and never goes away.
Me: You're right. Java has come a long way. Let's download...
Rust: No! No no on. Not like that!
---
Memory safety is a worthwhile goal, but combining it with manual memory management is wrong for most tasks. Just use a damn GC. Rust's safety-plus-malloc niche should be much smaller than it is.
For scripting etc. it is perfect though.
The biggest difference is the failure modes. If I'm not thinking about memory, my RSS is higher or a bit of extra CPU time goes to GC. Both of those are radically better than UAF or buffer overruns. Good trade IMO.
That's part of the reason why Python, go, Ruby, etc. are so popular.
There is no one right answer, it's very dependent on what's being built and where the ROI for the programming effort comes from.
It’s more important to learn how computers work and make the language just a means to understanding how they work. [...] even in this age of higher level abstractions and web development, it’s still important to understand the basics of CPU scheduling, memory, cache hierarchies, file systems, disc and file access. When you work directly above the syscall layer, whether in C, Zig or Rust, it really helps you understand what’s happening[...]
me> This [API | language feature | whatever] seems harder to use than it should be.
them> No, it's actually not.
me> Here's irrefutable proof.
them> Well at least you have memory safety.
me> But...you can have memory safety without this thing being a dumpster fire. Wouldn't that be better?
them> <no concessions, Rust is perfect>
After a few conversations like that, I've literally had those same otherwise high-caliber engineers spend days wrestling with the "easy" thing we were quibbling about. I'm sure it's not intentional, but it comes across as religious gaslighting.
And maybe I just interacted with the wrong people at the wrong point in Rust's lifecycle and the community is mostly very positive. I see enough people with experiences like mine though that I'm not willing to believe it's a truly miniscule fraction of the language's discourse.
It used to be that programming languages were mostly boring and predictable, with maybe questionable semantics (const etc.), but generally that messiness meant they were good enough at getting the job done.
PL research and theory focused on mostly FP, Ocaml family and other functional languages, with things like advanced type inference system, based on postgraduate category theory. These people have fought endless and bitter mental battles with each other, a glimpse of which occasionally leaked to HN. Some paper about a noteworthy discovery in solving a problem incomprehensible to the general public. Some guy complaining about how he tried to educate average programmers about how unsound their programs were, and being taken aback at how these people didn't want to be saved from their own stupidity. Some article complaining about how if every programmer was just 15 IQ points smarter, they'd be all doing FP. But mostly this community kept to themselves.
Thanks to Rust, all these ideas have found purchase in real practical software. Now the academics get to torment themselves with the moral duty of saving the everyman from using less theoretically sound programming languages.
(Disclaimer - I don't hate Rust, I think it's great they made this breakthrough from academia to regular boring programming, but they need to respect the nuance of the world that exists outside the walls of research institutions)
Scala (the v2 series, I haven't used v3 at all) was, to a first approximation, a language of, by, and for graduate students in language research that accidentally escaped the lab and briefly took over the data engineering space. Multiple competing category theory libraries, vicious fights about which was more pure, continued debates about the beauty and confusion of implicits resolution, the list goes on.
Rust seems downright blue collar in comparison. So much of the Rust I've written and the teams I've been on, and the open source we've used has been exactly the kind of stuff we would have used Java for 15 years ago. Boring practical stuff. Same goes for the community interactions. "Here's how to get this thing working", "here's a better way to do this", "maybe you didn't know but here's a cool way to speed up that section", etc.
Sure, if you go into the development process of The Rust Language Itself, people are talking about compiler minutiae and using datalog to do type resolution, but that _really_ has not been my experience as a user. Me and everyone I know use Rust like the Golang people say they use Golang.
In fact the crux of the difference between the Rust community and the Scala community has been Rust's continued obsession with developer experience/user experience (whatever you want to call it). The error messages, the tooling, etc. Scala had none of this. A disproportionately significant section of the Scala people were obsessed with type theory, quite often to the detriment of usability/programming experience.
I respect your experience with the Rust community but I haven't had this experience at all. Totally unrecognizable to me.
You can substitute that with Rust and it sums up my feelings. The language is great, the obsession with static typing and memory safety from its fans, as if it’s the panacea to all problems in computing, is obnoxious and smells of inexperience. It’s not a coincidence that Rust these days is baby’s first low level language, so you get a lot of strong, uninformed opinions on software design.