4 ms·
I actually feel like Rust makes more sense for a kernel than user mode-apps. If there's any software that you want provable safety guarantees on, it's the kerne
by dataflow 5y ago
I actually feel like Rust makes more sense for a kernel than user mode-apps. If there's any software that you want provable safety guarantees on, it's the kernel. What bothers me is the indiscriminate push to rewrite any and all user-mode apps in Rust. That one feels far less necessary to me in general, though there are exceptions obviously.
- lionkor 5y agoWow, yeah, good point. Rewrites in general are usually a terrible idea, unless the original is horribly broken (and beyond fixable). If you wrote your app in C++, instead of rewriting it for the next decade in Rust just to get to the same point, slap some AddressSanitizer, ThreadSanitizer, -fanalyzer, cppcheck, etc. on it. You will get 98% of the way there. Instead of spending 8+ years(!) rewriting[1] the GNU coreutils in Rust, you could spend half that time to ensure full coverage (branch-coverage, condition-coverage) in the existing ones. I will actually have a breakdown if someone tries to rewrite SQLite in Rust[2]. 1: https://github.com/uutils/coreutils https://github.com/uutils/coreutils 2: https://sqlite.org/testing.html https://sqlite.org/testing.html
- moocowtruck 5y ago>If you wrote your app in C++, instead of rewriting it for the next decade in Rust just to get to the same point, slap some AddressSanitizer, ThreadSanitizer, -fanalyzer, cppcheck, etc. on it. You will get 98% of the way there. if that were true, why is chrome still looking at rust, because they use all those tools already
- KptMarchewa 5y agoThere are obviously different people doing this stuff than original GNU coreutils people. I'd be very wary to try to contribute anything to old GNU project like that, since despite having right licensing ideas, they attract the biggest assholes. This might be another reason why different people are doing rewrites. And sometimes, it turns out extremely well, like ripgrep.
- caddybox 5y agoThe contributions of those assholes has been a massive factor in the success of the Linux/GNU ecosystem. I'd strongly urge potential contributors to speak with the real people behind the project rather than blindly trust the advice of somebody on the internet whose affiliations and interests can never be reliably ascertained.
- raxxorrax 5y ago> they attract the biggest assholes Are they assholes? Maybe millions of people using their tools and external expectation forms character? I think such quick judgements are often very special.
- samhw 5y ago> You will get 98% of the way there. "Kills 98% of viruses" is good enough for hand soap, but it's not good enough for the vital infrastructure that basically all software relies on. Now that we have self-driving cars, rockets, medical devices, etc relying on this infrastructure, I don't think a push towards total provable memory safety is a bad idea. (Though notice I said "total provable memory safety". If there's a way to get there without a rewrite in Rust, that's preferable a million times over.)
- lionkor 5y agoI hear you. But, to take my example of the GNU coreutils rewrite, even after more than 8 years it only passes 32% of the test cases that the C GNU Coreutils pass. That's not 98%, that's not even 90%. It's hard to rewrite good software. And something like SQLite shows that you can get 100% coverage (as in, every single statement is hit in the tests). That's 100%.
- throwaway47292 5y agoofftopic: sqlite is bad example, for example features like the FTS tokenizer code (https://research.checkpoint.com/2019/select-code_execution-from-using-sqlite/ https://research.checkpoint.com/2019/select-code_execution-f...), which were probably paid by commercial requests or sponsors. That is not to say sqlite does not have 100% coverage, it of course does, but you are building on top of infrastructure which is really really hard to be kept safe. Rust somehow makes it harder to make certain kinds of bugs, which comes at its own cost. PS: I don't like or dislike rust, just I have seen the sqlite example being brought a lot, and a lot of people didn't expect sqlite file to be an attack vector :) so nobody is even looking there.
- lolkillmeplz 5y agoIt is fucking bonkers that you seem to think that test coverage is even remotely in the same ballpark as writing in Rust, and yes it's made even more cringe by the implication that 100% line coverage is a worthwhile test metric. But then again, the concerning part was made obvious with the 98% comment. I'd fucking hate to ask what your opinion on COVID is.
- jsymolon 5y ago> Rewrites in general are usually a terrible idea, unless the original is horribly broken (and beyond fixable). I would say, it depends on the ROI. For example, my current millstone, is a 20 year c++ program written towards the c++98 spec. The physical hardware is held together with spit and best wishes with the current management stating that we need to move to a Linux based, Intel platform as that's what 99% of the org is on. And, we're not licensing Vendor A or B's product, therefore "patch it till the major rewrite is completed". In the intervening 20 years, C++11, 17 or even 20 is very different from 98. Will I rewrite the whole thing, nope, as there's another project to rewrite the client/server portion (again 20 years ago) and at that time, I will eliminate that c++ piece.
- vlmutolo 5y agohttps://dev.to/thepolyglotprogrammer/what-would-sqlite-look-like-if-written-in-rust-part-1-2np4 https://dev.to/thepolyglotprogrammer/what-would-sqlite-look-...
- selfhoster11 5y agoMy feeling is that for coreutils-like user-mode apps, the push is not to rewrite them in Rust, but rather to rewrite them at all. Coreutils and the standards they are based on are far behind what's possible with CLI UX, and I feel like that amounts for some of the effort. That's certainly why I myself cheer this movement on. I want to see a nicer Unix.
- pjmlp 5y agoMostly agree, a D style language is more suitable for userspace applications.