Long-term, it's considered a strong signal for the health and viability of Rust if it's not strictly tied to one implementation.
For example, for arm-none-eabi, ARM provides a GCC toolchain (https://developer.arm.com/Tools%20and%20Software/GNU%20Toolc...) but makes you purchase the LLVM-based one (https://developer.arm.com/Tools%20and%20Software/Arm%20Compi...). Now I'm fairly certain there's an open-source way to target ARM microcontrollers with LLVM but you can't download it from ARM...
$ rustup target list | grep arm | grep none
armebv7r-none-eabi
armebv7r-none-eabihf
armv7a-none-eabi
armv7r-none-eabi
armv7r-none-eabihf
... which means the publicly-available open source version of LLVM also supports it.edit: looking into this more, yes, upstream clang/llvm should work, though it doesn't include a C stdlib for this target (of little import to Rust, presumably), so you'll have to find one (e.g. by taking it from the GNU toolchain) if you want to use a C stdlib on embedded. Who knows what secret sauce armclang adds to clang...
I briefly looked at the license and it seems that if you're getting it for free, then its all good, you just get no support.
(I only write Rust on ARM and so am unfamiliar with the various toolchains they offer, honestly.)
edit: My legalese is not great, but isn't the the license saying that you can't legally distribute software compiled with the LLVM-based ARM tools if you obtained it for free? Obviously the gcc-based tools can't have such restrictions.
3.2 NON-COMMERCIAL USE AND FREE OF CHARGE LICENSES:
...
(b) if you are receiving a Non-Commercial Use License or version (as applicable) of the Arm Tools:
(i) you and your Permitted Users may use the Arm Tools for internal use only; and
(ii) you are not permitted to distribute or sub-license (A) any part of the Arm Tools, or (B) Your Software,
Your Hardware, or Your Reports developed under this License using the Arm Tools. The Arm Tools shall be
used only by you and your Permitted Users, and you shall not (except as otherwise authorised in writing by Arm)
allow any other third party whatsoever to use the Arm Tools.
For the avoidance of doubt, if you are receiving a Non-Commercial Use License and the license is provided to you free of
charge, the restrictions in both sub-clauses (a) and (b) above will apply to your use of the Arm Tools.
additional edit:Here's what happens when I try to run armclang:
$ armclang
armclang: error: Failed to check out a license.
The license file could not be found. Check that ARMLMD_LICENSE_FILE is set correctly.
I did not bother to figure out if there's a way to get a license without paying (though I would likely qualify for a non-commercial license as an academic user, but it seems like a pain).But who knows, honestly they make this stuff as confusing as possible, it seems.
GCC targets more platforms than LLVM, that much is true. But beyond that, it's pretty common in the microcontroller world for a vendor to release their own specially patched version of GCC blessed for a given platform. They simply aren't doing that for the LLVM.
Those blessed GCCs aren't often seeing the hacks merged upstream.
Here's one such example:
https://www.ti.com/tool/MSP430-GCC-OPENSOURCE?keyMatch=gcc&a...
GCC had laughably bad error messages before LLVM caught on. Even then, LLVM generated terrible code compared to GCC. There's a similar competition going on with open source linkers (which are finally going multi-threaded).
Both compiler toolchains currently blow pre-LLVM GCC out of the water (and GCC development has noticeably accelerated since LLVM came out).
I'm not sure which one is better at which C++ thing these days, but I'll bet GCC Rust will beat LLVM Rust at some important things in a few years (and then vice versa).
In what concerns Apple, I think they mostly care about the C++ support needed to keep LLVM going, the C++14 based dialect for Metal Shading Language, and the subset used across IO and DriverKit.
For everything else there is Objective-C and Swift.
Then Google apparently drop off clang after the ABI break votes didn't went the way they wanted, so they are now focusing on Abseil, and their style guide is anyway quite restrictive.
So now we are in this ironic situation, that VC++ from all compilers is the one with best C++20 support, closely followed by GCC, and then there is clang and the other lesser known ones still lagging in C++17 and earlier.
It's so extraordinarily, mind-bogglingly stupid. But I guess it is time for the ageing C++ queen to pushed out of the mortal coil and let Princess Rust grab her long-overdue system crown.
Did you know on MSVC a std::mutex is so huge it needs more than one cache line ? Obviously Microsoft aren't stupid, they know how to fix that... but it would change the ABI so they can't touch it.
And so the Zero Cost Abstraction promise "Don't pay more than it would cost if you did it yourself" becomes "Eh, just do it yourself" everywhere - C++ programmers learn to hand roll all the basic stuff they need, because ABI stability has ensured the standard library mechanisms are slow, or bloated, or both.
Either Rust wants to play on that field, or it doesn't.
Microsoft has broken their ABI plenty of times, and VS vNext might be when the next break will take place, which was initially planned for VS 2022.
Bashing C and C++ ABI issues on HN will do very little for those businesses to adopt source code distributions.
Some famous C++ frameworks that ship as binaries are OWL, VCL, FireMonkey, MFC, ATL, WinUI.
And WinRT has improved upon classical COM ABI to provide even more data types.
On Windows there is a component market selling libraries for those ecosystems.
Then we have middleware vendors for game consoles as well.
Maybe this isn't a market Rust community cares about and that is fine.
Microsoft is stupid enough since the first decision of the implementation impacting the ABI is made. There was no one enforcing such bad decisions shipped into the productions at the very beginning. Both libstdc++ and libc++ have more flexible rules to preventing ABI breakage.
At least from the comments I sometimes see flying by on Reddit.
https://users.rust-lang.org/t/where-is-the-rust-language-spe...
"For the most part though, rustc itself is the spec" - so, for implementing the GCC frontend, read the current LLVM frontend really carefully and do everything the same way? And try to keep up with all the changes which will inevitably happen in the LLVM frontend while you are implementing the GCC frontend?
At a high level, this is correct: https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Ques...
> If gccrs interprets a program differently from rustc, this is considered a bug.
I don't believe they are only reading the frontend, but using the reference first, then looking to the implementation second, and asking a lot of questions along the way.
(btw, there's also https://doc.rust-lang.org/reference/)
With an ideal standard document that describes the language, someone could build a compiler for the language from scratch and it should behave correctly. See https://en.wikipedia.org/wiki/Programming_language_specifica...
Some example standards:
C: https://www.open-std.org/jtc1/sc22/wg14/
ECMAScript (Javascript): https://tc39.es/ecma262/
C++: https://isocpp.org/std/the-standard
Scheme: https://schemers.org/Documents/Standards/
Ada: http://www.ada-auth.org/standards/ada12_w_tc1.html
For Rust, Ferrous Systems is working on the Ferrocene Language Specification to formally document the Rust subset that Ferrocene will use.
https://ferrous-systems.com/blog/ferrocene-language-specific...
ISO will stamp any fantasy like OOXML, but that doesn't mean the standard is useful.
The main benefit of a GCC front-end is to move Rust beyond a single vendor, and shakeout ambiguities in the (informal) language specification.