4 ms·
One of the famous non memory safety bugs in sudo recently was related to using a sigil, which Rust would have prevented because the natural and easy solution in
by jackmott42 3y ago
One of the famous non memory safety bugs in sudo recently was related to using a sigil, which Rust would have prevented because the natural and easy solution in Rust for those use cases is an Enum/Sum Type.
Which is to say that Rust has safety features beyond just what we are used to from garbage collected languages. Sum types, stricter typing, data race protections, etc.
- c_crank 3y agoA whole laundry list of languages have stricter typing than C, garbage collected or not.
- Zamiel_Snawley 3y agoAnd yet, Rust is being taken seriously in many places where those languages have been unable to displace C. I wonder if it hadn't taken 15 years for a FOSS Ada compiler to become available, maybe it would have taken off.
- c_crank 3y agoAda never had the same level of marketing power towards engineers that Mozilla came up with. GNAT still came out well before Rust did.
- Zamiel_Snawley 3y agoI suppose my point was that Ada had missed it's shot-by the time GNAT came out, the buzz of an exciting new language expired before people could easily use it. I'm not familiar with the marketing that Mozilla did, but whatever they did it does seem to have been effective. However, I do think that the Ada mandate by the DoD would be equivalent or more effective in kick-starting an ecosystem.
- c_crank 3y agoDoD software and the commercial / FOSS world rarely intersect. The last time the government tried to set a computing language standard, we got COBOL, so it's probably for the better such a thing isn't tried again. The marketing Mozilla employees have came up with is creating a Categorical Imperative for using Rust. The person in the comments section of a C project or any CVE bug will be saying, this would never have happened if this was written in Rust, why aren't you writing this in Rust? The moral thing to do was to write it in Rust! And a lot of software engineers are eager to think and talk like this, because it gives them something more exciting in their lives beyond writing bean counters for selling widgets. Pure functional languages already had a bit of that attitude, but I don't think it caught on nearly so much because actually writing pure functional code is very difficult even for most engineers.
- dragonwriter 3y ago> The last time the government tried to set a computing language standard, we got COBOL, Ada, actually (well, that might not be the last time, but it is certainly much more recent than COBOL.) COBOL and JOVIAL were roughly concurrent – both efforts started in 1959, I believe – but the effort that culminated in Ada started in the mid-1970s.
- c_crank 3y agoI should have clarified that I meant a universal standard. COBOL was meant to create a common language across business and government, while Ada was meant to just consolidate a language across DoD projects. Ada is a much better language than COBOL, but I think that adoption of even a good language across those ecosystems will only succeed when it is adopted from the ground up.
- dragonwriter 3y agoCOBOL also wasn’t a government-launched initiative, it was an industry initiative that went to the government for funding, unlike Ada which was born as a DoD initiative. If COBOL was worse for its time than Ada was for its time (which I don’t think is clear, though I’d rather work with Ada than COBOL if I had to pick one today), maybe that would support an argument about customer-need driven projects vs. vendor-imagination-driven projects.