News for hackers. Stuff that matters.
Re:GCC Rust: GCC Front-End for Rust by oconnor663 on Sunday January 10, 2021 @12:32PM (#25717034)
The LLVM-based Rust compiler uses a lot of unstable/nightly-only Rust features internally. So even if this project got to the point where it could compile all stable Rust programs, I think it would take quite a bit more work than that to be able to compile `rustc` itself. (It might be that the unstable stuff is mostly in the standard library and not the compiler itself? Does it make a difference?)
Re:GCC Rust: GCC Front-End for Rust by steveklabnik on Sunday January 10, 2021 @01:12PM (#25717533)
> It might be that the unstable stuff is mostly in the standard library and not the compiler itself? Does it make a difference?

It might. There are at least two major things off the top of my head, regarding libstd:

1. specialization is needed for performance around String and &str

2. const generics are needed to support some trait implementations

We currently allow some stuff like this to leak through, in a sense, when we're sure that we're actually going to be making things stable someday. An alternative compiler could patch out 1, and accept slower code, but 2 would require way more effort.

There has been some discussion about trying to remove unstable features from the compiler itself, specifically to make it easier to contribute to, but it unlikely that it will be completely removed from the current implementation of libstd for some time.

Re:GCC Rust: GCC Front-End for Rust by CodesInChaos on Monday January 11, 2021 @11:26AM (#25731136)
Doesn't min_const_generics (stable once 1.51 releases on 2021-03-25) cover everything std needs (implementing traits for arbitrary array sizes)?
Re:GCC Rust: GCC Front-End for Rust by steveklabnik on Monday January 11, 2021 @11:35AM (#25731322)
I believe that it does, yes. We haven't hit that in stable yet, though, so I am speaking purely in the present. You're right that it's looking good for stabilization in a few months, but anything can happen, in theory. I'm more trying to illustrate the point, that significant features can depend on something that's unstable currently. Those impls landed well before it was even marked as being stable in nightly.
Re:GCC Rust: GCC Front-End for Rust by cbmuser on Sunday January 10, 2021 @04:32PM (#25720159)
Isn‘t mrustc already able to compile rustc?
Re:GCC Rust: GCC Front-End for Rust by steveklabnik on Sunday January 10, 2021 @04:39PM (#25720221)
Yes.
Re:GCC Rust: GCC Front-End for Rust by oconnor663 on Monday January 11, 2021 @10:42AM (#25730384)
Oh that's impressive. I didn't know it was that far along.
Re:GCC Rust: GCC Front-End for Rust by steveklabnik on Monday January 11, 2021 @11:33AM (#25731288)
It managed to do it for the first time Dec 24 2017 https://www.reddit.com/r/rust/comments/7lu6di/mrustc_alterna...

> It's managed to build rustc from a source tarball, and use that rustc as stage0 for a full bootstrap pass. Even better, from my two full attempts, the resultant stage3 files have been binary identical to the same source archive built with the downloaded stage0.