Live data from Hacker News

Rust to C compiler – 95.9% test pass rate, odd platforms

fractalfir.github.io

141–150 of 264 posts

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#141

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

That applies to your distro package manager too.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#142
post #127

Earlier 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.

It is, but it is still tiny compared to C/C++. And many people also do not like it.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#143
post #128

Earlier 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.

Yes, it also has many aspects I do not like about it. Let's not pretend everybody shares your enthusiasm for it.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#145
post #31
post #21

Of 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.

Right, and that probably should have been the link rather than some in-process thoughts about popcount or w/e. Sorry for not figuring it out and clicking around effectively.

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#146

Earlier 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…

Hi, retro computing person here. I've had a similar debate with Rust evangelists in past

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

#147

Earlier 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.

Very strong statement, one I don't really believe

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#148
post #143

Earlier quoted context omitted.

Borrow checker is not the only feature that makes Rust great though.

Yes, it also has many aspects I do not like about it. Let's not pretend everybody shares your enthusiasm for it.

What aspects do you not like about Rust?

Re: Rust to C compiler – 95.9% test pass rate, odd platforms

#149
post #61
post #36

Earlier 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, ..

Vala [1] is, perhaps, the most prominent example of practically used programming language with such compiler.

[1] https://en.wikipedia.org/wiki/Vala_(programming_language)

Post reply on HN