gccrs
mrustc
Our great sponsors
gccrs | mrustc | |
---|---|---|
102 | 75 | |
2,246 | 2,069 | |
2.7% | - | |
9.9 | 9.0 | |
3 days ago | 5 days ago | |
C++ | ||
GNU General Public License v3.0 only | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gccrs
-
Why do lifetimes need to be leaky?
That's why gccrs doesn't even consider lifetime checking a part of the language (they plan to use Polonius, too).
-
How hard would it be to port the Rust toolchain to a new non-POSIX OS written in Rust and get it to host its own development? What would that process entail?
There's ongoing work on a Rust front-end for GCC (https://github.com/Rust-GCC/gccrs). Bit barebones right now -- ie, even core doesn't compile -- but there's funding, demand, and regular progress, so it'll only get better from there. Once gccrs can compile core, it should be ready to compile most of Rust, and thus if you've taught the calling conventions for C to GCC, you're golden.
-
Rust contributions for Linux 6.4 are finally merged upstream!
Do you mean this project https://rust-gcc.github.io/ ?
That is what theyre refering to, yes. The GitHub is named https://github.com/Rust-GCC/gccrs
Unsure currently, but there is project to get gcc to compile rust directly https://rust-gcc.github.io/ that is working to get changes upstreamed.
-
GCC 13 and the State of Gccrs
- But this misses so much extra context information
3. Macro invocations there are really subtle rules on how you treat macro invocations such as this which is not documented at all https://github.com/Rust-GCC/gccrs/blob/master/gcc/rust/expan...
Some day I personally want to write a blog post about how complicated and under spec'd Rust is, then write one about the stuff i do like it such as iterators being part of libcore so i don't need reactive extensions.
-
Any alternate Rust compilers?
Another upcoming implementation is Rust-GCC. This may help with wider adoption of Rust programs, but it probably won't see much use or support by Rust users. Furthermore, it will probably take some time to be implemented, since writing a compiler frontend is a difficult task.
In the future: gccrs (https://github.com/Rust-GCC/gccrs) is making progress, but is not useful now. It will be the first alternative compiler for Rust if/when complete (it probably will be completed because of the whole Rust for Linux effort)
(Speaking of which, Rust-GCC (or gcc-rs or gccrs or whichever other of their names they decide is the primary one) isn't even going to be a complete C++ implementation. Their plan is to implement enough to compile Polonius (the NLL 2.0 borrow checker being developed in Rust for rustc) and then share that since borrow-checking isn't necessary for codegen... only to identify and reject invalid programs... making the C++ portion of it not that different in scope from mrustc.)
-
why GNU grep is fast
If it were proposed, it may end up being a political issue. GNU wants things under their umbrella to be GNU GPL licensed, and the rust compiler is not. There is work to get a Rust compiler built into gcc, but it's not nearly ready yet.
mrustc
-
Why do lifetimes need to be leaky?
No, you don't. Existential proof: mrustc ignores lifetimes. Just flat out simply ignores. It changes some corner-cases related to HRBT, yet rustc compiled by mrustc works (that's BTW mrustc exist: to bootsrap the rustc compiler).
-
I think C++ is still a desirable coding platform compared to Rust
Incidentally C++ is the only way to bootstrap rust without rust today.
-
Rust – Faster compilation with the parallel front-end in nightly
Well, there is mrustc[0], a Rust compiler that doesn't include a borrow-checker, so it's possible to compile (at least some versions of) Rust without a borrow checker, though it might not result in the most optimized code.
AFAIK there are some optimization like the infamous `noalias` optimization (which took several tries to get turned on[1]) that uses information established during borrow checking.
I'm also not sure what the relation with NLL (non-lexical lifetimes) is, where I would assume you would need at least a primitive borrow-checker to establish some information that the backend might be interested in. Then again, mrustc compiles Rust versions that have NLL features without a borrow-checker, so it's again probably more on the optimization side than being essential.
- Running the "Reflections on Trusting Trust" Compiler
-
GCC 13 and the state of gccrs
Mrustc supports Rust 1.54.0 today
- Any alternate Rust compilers?
-
Stop Comparing Rust to Old C++
There are three. The official one, mrustc (no borrow checker, but can essentially compile the official rustc) and GCC (can't really compile anything substantial yet). Only rustc is production-ready though.
-
“33% of GStreamer commits are now in Rust”, from the 1.22 release notes
Otherwise you could try compiling to C using mrustc and going from there, but as mrustc is really only intended for compiler bootstrapping it won't be a fun experience. Mrustc mostly just assumes that the code you're compiling is valid, so you lose all the advantages of choosing Rust over C in the first place. It also targets x86-64 so the C it emits might need some work before it'll compile.
-
Am I dumb or does rust have a garbage collector?
In fact, https://github.com/thepowersgang/mrustc compiles code without the need for a borrow checker :-)
-
GCC Rust Front-End Cleared For Merging In GCC 13
Instead of an independent re-implementation, a small niche implementation whose only purpose is to bootstrap, like mrustc. Since its a much smaller scope, and only intended to work on known correct code, its much simpler and easier to do. It doesnt need to do any type or borrow checking or much of anything, because the rust source is already known to be correct/checked by itself.
What are some alternatives?
gcc-rust - a (WIP) Rust frontend for gcc / a gcc backend for rustc
rustc_codegen_gcc - libgccjit AOT codegen for rustc
rustc_codegen_gcc - libgccjit AOT codegen for rustc
mold - Mold: A Modern Linker 🦠
rust - Empowering everyone to build reliable and efficient software.
Rust-for-Linux - Adding support for the Rust language to the Linux kernel.
polonius - Defines the Rust borrow checker.
gccrs - GCC Front-End for Rust
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
llvm-cbe - resurrected LLVM "C Backend", with improvements
rust-ttapi
whisperfish