6 ms·
Adding a Rust compiler front end to GCC [video]
- kzrdude 4y agoThis talk is about https://rust-gcc.github.io https://rust-gcc.github.io
- kibwen 4y agoBecause there is often some confusion, note that there are two different projects in this space with different approaches. The project discussed in the video above is a new front end to GCC (written in C++, as is typical for GCC frontends) and is developed here: https://github.com/Rust-GCC/gccrs https://github.com/Rust-GCC/gccrs The other project involves plugging GCC's backend into the existing rustc frontend, and is developed here: https://github.com/rust-lang/rustc_codegen_gcc https://github.com/rust-lang/rustc_codegen_gcc Both projects intend to eventually allow Rust code to make use of GCC. But they will likely appeal to different sets of users: the former project appeals to people invested in the GCC ecosystem who want to use Rust without installing a whole separate toolchain, and the latter to people invested in the Rust ecosystem who want to benefit from GCC's broader target support.
- dannymi 4y agoAnd then there's mrustc https://github.com/thepowersgang/mrustc https://github.com/thepowersgang/mrustc , a Rust compiler written in C++, using LLVM.
- CohenArthur 4y agoIt's important to note that mrustc is not intended for everyday use and instead as a bootstrap compiler for rustc (at least originally). We would like to develop an alternative that is suitable as a daily rust compiler and that integrates into the existing Rust ecosystem (and makes use of it!)
- kzrdude 4y agoThat's claimed for two reasons - bootstrapping is the first milestone of a working and useful rust compiler. In this case; if it couldn't be used for anything else, at least it could do that. It's also claimed that "it will only be that" to seem more non-threatening to the main Rustc project. If it was “easy” to do, mrustc would of course support all of the Rust language. Maybe it will get there if there is enough work and interest. There was this vague concern about splitting the ecosystem. The concern is understandable - to an ecosystem that has been "in control" by a central implementation for a decade. I would file it under growing pains. Rust can't, when it grows up, always be a single-implementation language.
- hvdijk 4y agoYou're saying the project's maintainer is deliberately misrepresenting mrustc's goals in order to prevent malicious interference by the Rust community? Both of those seem very unlikely to me and I can't see anything in your message to provide support for those claims. I see no reason not to just take things at face value here.
- kzrdude 4y agoIn fact the project itself doesn't claim it will only be that. But in the community, this idea is still spread around.
- kibwen 4y agoRather than being afraid of interference, the reason that the mrustc author is so careful in their wording is that nobody has ever bothered to define what it means to be a "compatible" implementation of Rust, which is a semantic and legal hurdle that the implementation in the OP will have to clear. In a more concrete sense, mrustc can't currently be a compatible implementation of Rust, because (by dint of lacking a borrow Checker) it accepts more programs than rustc does (arguably it's fine to accept strictly fewer programs than rustc does and still be called a compatible implementation).
- 4y ago
- est31 4y ago> a Rust compiler written in C++, using LLVM. FTR mrustc does not use LLVM, it compiles to C, which is then compiled using a C11 compatible compiler. So it can "make use of LLVM" through clang for that last step, but that's not usually what people mean when they say that some project uses LLVM.
- rapsey 4y agoAs well as a cranelift backend https://github.com/bjorn3/rustc_codegen_cranelift https://github.com/bjorn3/rustc_codegen_cranelift
- woodrowbarlow 4y agobut doesn't rustc already use llvm as its backend?
- kibwen 4y agoIt does, but the rustc frontend is capable of supporting several backends, and different backends offer different features (e.g. compilation speed, code quality, platform support).
- isaacfrond 4y agoIs it just me or would other people vastly prefer a blog post instead of a video? I mean there is 0 chance that I’d watch this in the office. This is basically NSFW. But I like gcc and would probably take that minute to scan the article
- dividedbyzero 4y agoDefinitely prefer text to video for content like this, but I don't get the nsfw part. Seems perfectly acceptable to me.
- hoistbypetard 4y ago> I don't get the nsfw part I interpreted that to mean that in the poster's workplace, they can't just put headphones on or play sound through their PC's speakers, but they could read through a blog post in the downtime between tasks. I've worked in environments like that, anyway, and think they're pretty common.
- yjftsjthsd-h 4y agoWhat environment doesn't allow headphones? (I guess if it's an availability indicator?)
- hoistbypetard 4y agoUsually one where you're expected to answer the phone.
- throwaway9870 4y agoSometimes it is done as part of a talk and hence it is natural to be a video. But that being said, I normally skip over videos when looking for information on a technical topic. I find, for me at least, my learning to time ratio is far better with a text document than a video. Not sure why you are being down voted, it seems to be an interesting conversation of video vs written material for highly technical content.
- Aissen 4y agoI'm curious if anyone has any feedback on polonius ? Is it still active ? Is it still supposed to be the next-generation borrow checker ?
- mjw1007 4y agoAs I understand it, Polonius is still intended to be the next version of the borrow checker. The repostory is here: https://github.com/rust-lang/polonius https://github.com/rust-lang/polonius There doesn't seem to have been any meaningful development for well over a year. There is some very recent discussion on Zulip which makes it look like there are at least two or three people interested in actively working on it. https://rust-lang.zulipchat.com/#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/polonius.20roadmap https://rust-lang.zulipchat.com/#narrow/stream/186049-t-comp...
- nestorD 4y agoIt is still active[1] and he goal is indeed for it to be the next borrow checker. [1]: two months ago: https://www.reddit.com/r/rust/comments/ufmzcl/is_polonius_dead_3_commits_in_7_months/ https://www.reddit.com/r/rust/comments/ufmzcl/is_polonius_de...
- oxff 4y agoIsn't this breaking the Rust language into two?
- steveklabnik 4y agoNo, it is not. https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Questions#what-is-the-plan-for-inconsistencies-in-behaviour https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Ques...
- stjohnswarts 4y agonot at all, it's no different than having gcc, clang, and lcc. It's just another compiler, they are still building toward the spec.
- heavyset_go 4y agoAnyone have a link to the slides from the video?