Earlier quoted context omitted.
People may learn from material that uses C for illustration purposes, but that won’t prompt them to write their own C. And don’t even mention ecosystem support in C/C++ where developers are notorious for reimplementing everything on their own because there is no package manager.
"rust import csv-parser" "you've installed 89 packages" why is my executable 20 mb, not as performant as a 50 kb C file & doesn't build a year later if I try to build with 89 new versions of those packages obligatory xkcd reference: https://imgs.xkcd.com/comics/dependency_2x.png this is what package managers lead to
Rust to C compiler – 95.9% test pass rate, odd platforms
141–150 of 264 posts
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#142Earlier quoted context omitted.
Probably not. Many people prefer C/C++ to Rust, which has its own fair share of problems.
Two people is many people. The general trend I see is that Rust is exploding in adoption.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#143Earlier quoted context omitted.
I think we will get the same safety benefits of Rust in a version of C relatively soon.
Borrow checker is not the only feature that makes Rust great though.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#144Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#145Of course, everyone votes up the headlines, but this link seems like premature WIP. Hopefully this will get posted for real after the presentation.
I clicked through to the project at https://github.com/FractalFir/rustc_codegen_clr - from a quick glance at it, with 1.8k stars and 17 contributors, it deserves a better treatment than a passive—aggressive dismissal like this as a top comment. It is a very impressive piece of work.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#146Earlier quoted context omitted.
They're still common (except for alpha) platforms in some market segment specific corners of embedded development. So, maybe for those purposes? Though, the trend I'm seeing a lot of is greenfield projects just migrating their MCUs to ARM.
> Though, the trend I'm seeing a lot of is greenfield projects just migrating their MCUs to ARM. That’s what I would expect, too. The Venn diagram of projects using an old architecture like alpha but also wanting to adopt a new programming language is nearly two separate circles. The parent comment even included HPPA (PA-RISC) which almost makes me think they’re into either retro computing or they have some arbitrary…
Something the Rust community doesn't understand is when they shout "REWRITE IT IN RUST!" at a certain point that's simply not possible
Those mainframes your Bank runs? I'm sure they'd love to see all that "awful" FORTRAN or C or whatever other language rewritten in Rust. But if Rust as a platform doesn't support the architecture? Well then that's a non-starter
Worse still, Rust seems to basically leave anything that isn't i686/x86_64 or ARM64 as "Tier 2" or worse
This specific line in Tier 2 would send most project managers running for the hills "Tier 2 target-specific code is not closely scrutinized by Rust team(s) when modifications are made. Bugs are possible in all code, but the level of quality control for these targets is likely to be lower"
Lower level of quality control when you're trying to upgrade or refactor a legacy code base? And the target is a nuclear power plant? Or an air traffic control system? Or a bank?
The usual response from the Rust evangelists is "well then they should sponsor it to run better!" but the economics simply don't stack up. Why hire 50 Rust programmers to whip rust-m68k into shape when you can just hire 10 senior C programmers for 20% of the cost?
EDIT: Architecture, not language. I need my morning coffee
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#147Earlier quoted context omitted.
I do, and will, the industry does and will, for at least a few more decades. And I even enjoy doing so (with C; C++ is more forced upon me, but that'll be the case for some time to come)
That’s what I’m saying. By a few decades you and most of those alleged 7 million C/C++ developers will retire and there won’t be anyone to replace them because everyone will be using Rust or Zig or Go.
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#148Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#149Earlier quoted context omitted.
I think there are probably C compilers for more platforms than there are rust compilers. So, if you want to compile your rust project on some obscure platform that doesn’t have a rust compiler for it yet, you could compile to C and then compile the resulting C code for that platform? Just a guess.
This is a fairly common technique in compiler construction and programming language research: Don't try to emit some machine code, instead emit C or an IR for clang or GCC. And suddenly your little research language (not that rust is one) is executable on many, many platforms, can rely on optimizations the compilers can do, has potential access to debug handling, ..
[1] https://en.wikipedia.org/wiki/Vala_(programming_language)
Re: Rust to C compiler – 95.9% test pass rate, odd platforms
#150.NET
Core tests 1662 39 12 97.02%
C
Core tests 1419 294 82.83%
Missing from HN title: The "95%" pass rate only applies to .NET. For GCC/Clang it is only "80%".