Rust bandwagon
Rust bandwagon
Posted Jan 3, 2023 22:56 UTC (Tue) by eean (subscriber, #50420)In reply to: Rust bandwagon by summentier
Parent article: Welcome to 2023
Rust getting immense credibility from its use in Linux is very real though. You'd be able to tell your students "it's used by Linux now" and folks in the workforce will be able to tell their managers the same.
Posted Jan 5, 2023 20:59 UTC (Thu)
by acarno (subscriber, #123476)
[Link] (9 responses)
In short, I've become a huge Ada evangelist, but I'm sadly aware that it'll never see the meaningful uptake that Rust and other "modern" languages will.
Posted Jan 5, 2023 21:43 UTC (Thu)
by khim (subscriber, #9252)
[Link] (8 responses)
For a longest time Ada looked like insane contradiction: it offered tools to control stuff above and beyond what even Rust may offer while simultaneously refusing to even attempt to solve the biggest issue of them all, memory safety. Eventually it took page from the Rust's book and is now, apparently, safer than Rust, but it's still no-community language (does it even have any popular non-trivial libraries?) which makes it non-starter for most projects.
Posted Jan 7, 2023 9:06 UTC (Sat)
by joib (subscriber, #8541)
[Link] (7 responses)
I guess people developed an instinctive dislike for it because they were forced to use it, thanks to DoD contracts requiring it's use. Then the Ada toolchain vendors took the opportunity to fleece the captive users as hard as possible, killing Ada usage except for DoD contracts. And for civilian usage C came to dominate thanks to Unix and compilers being free or at least cheap.
And eventually when the DoD stopped requiring Ada it all but died.
Sometimes I wonder about an alternative history where Ada instead of C became the 'standard' systems programming language. Oh, how much less security vulnerabilities would we have to endure. *sigh*
Posted Jan 7, 2023 13:57 UTC (Sat)
by khim (subscriber, #9252)
[Link] (6 responses)
I don't think so. Ada, for years, covered the remaining 30% well, but never had an answer to the main problem of these pesky 70%. Today… it borrowed the solution from Rust, sure, but before that… it was only “safe” in a limited world of “no dynamic memory”. Thus we could have had somewhat smaller number of vulnerabilities, but hard to say how much.
Posted Jan 9, 2023 22:50 UTC (Mon)
by NYKevin (subscriber, #129325)
[Link] (5 responses)
[1]: All of the bugs documented in https://youtu.be/9xE2otZ-9os?t=189 are the result of reusing statically-allocated memory. In fairness, this technique is technically equivalent to using a fixed-size (block) allocator with a very small heap. But then you can describe almost any use of non-stack memory as "technically" some kind of dynamic allocation.
Posted Jan 9, 2023 23:38 UTC (Mon)
by khim (subscriber, #9252)
[Link] (4 responses)
Well… affine types (which Rust and now Ada are using to solve handling of dynamic memory issues) were, initially, invented by mathematicians and adopted by GC-based functional languages. Not to manage memory, but to manage external resources (in that case “they would be freed but we have no idea when, precisely” is bad answer). Rust discovery (as with TMP it was discovered, not designed into the language from beginning) was surprising and somewhat startling and it's not even mathematical fact, but a social one: if you give people an easy-to-use affine type system then they can solve almost all practical memory handling problems without GC, just with a small amount of It's still not clear whether you can rewrite piecemeal any old code with similar results (which is what Linux Rust project is, essentially, trying to do) or whether you have to design everything from scratch for that phenomenon to work, but the whole thing wasn't pre-planned when Rust was first imagined. But yes, heap is definitely not the only resource which you need to manage… just, probably, the most important one. And it's scary how many really profound, important results are not designed, but discovered when people design something entirely different… are there similarly simple things which could have changed our computing (or maybe more than just computing) world as profoundly and which were just simply not discovered in time?
Posted Jan 10, 2023 12:12 UTC (Tue)
by kleptog (subscriber, #1183)
[Link] (3 responses)
The thing I found most amazing was its impact on some junior developers. They'd start with C and pointers and get themselves tangled into knots keeping the ownership/concurrency/etc straight. But after using Rust for a while they'd internalised the model such that after that coding C became much less scary because they had a model that they knew that worked, and all C needed was some boilerplate that the Rust compiler handles for you (i.e. working without guardrails).
The resulting programs became better simply because they understood the ownership of the objects they're manipulating, rather than just throwing pointers around. Some of us had to learn that the hard way using debuggers on segfaulting programs.
Posted Jan 10, 2023 17:08 UTC (Tue)
by farnz (subscriber, #17727)
[Link] (2 responses)
One thing I've seen time and time again with junior developers is that they've not yet internalised the rules of programming (in any language, not even the one they're working in), and are reliant on the computer telling them that they've made a mistake. Having this happen at compile time is better, but even a runtime exception (like in Java or C#) is an enormous help, since it means you get feedback that you've written something illegal.
In this context, C's thing of "if it's UB, the computer can silently do the wrong thing" is really bad for a developer's education, since the computer will often appear to work even though the developer has done the wrong thing (buffer overflow, use-after-free). Rust's move to "in order to even have UB, you need the unsafe keyword" means that junior developers know to stay away from potential UB, and thus avoid the C problem, since it's obvious to them that they're potentially making a mistake.
Posted Jan 10, 2023 19:36 UTC (Tue)
by khim (subscriber, #9252)
[Link] (1 responses)
This complicates life with junior developers, but they are not the most problematic case. Look on that whole discussion. Wol is most definitely is not a junior. It's not easy to educate junior developers, but it's almost impossible to educate senior ones… because often they firmly believe they know in this or that undefined language construct does. Even if documentation says something else.
Posted Jan 10, 2023 19:46 UTC (Tue)
by Wol (subscriber, #4433)
[Link]
(Not helped because C is not my language of choice.)
Cheers,
Rust bandwagon
Rust bandwagon
Rust bandwagon
> Oh, how much less security vulnerabilities would we have to endure.
Rust bandwagon
Rust bandwagon
Rust bandwagon
unsafe
code.Rust bandwagon
Rust bandwagon
Rust bandwagon
Rust bandwagon
Wol