What I don't understand is this whole thing about bootstrapping a new arch by building a whole new compiler on it, then compiling the source of an existing compiler on it (twice). Bytes of machine code don't have color, it's just a regular pile of bytes like everything else. Why does the compiler even have to run on the new arch? Just build a new backend for an existing compiler, then cross compile. It makes no sense to me why the machine code of a system must be assembled on that system.
I don't mean to sound adversarial, I'm just very confused.
Assembling the machine code of a system on itself means it's independent of its "parent" system. If I can't run the compiler on my new architecture (including compiling itself), I'll forever depend on having another machine with a different architecture to compile things. Yes, usually it's done by writing a new backend for an existing compiler, then using the new backend to cross-compile the compiler itself, and finally running the resulting compiler on the new architecture; you don't have to write a whole new compiler from scratch, unless you're worried about "trusting trust" attacks.
In the same way, when compiling a new version of a compiler, having the recently-built compiler build itself again makes sure it's independent of its "parent" compiler.
Far as a compiler, that doesn't really matter for most systems (esp embedded). You can cross-compile to any architecture you want with portable code and a new backend. The only tools you need for each architecture's CPU's/MCU's are something to load and test the code. Those already exist in embedded sector. Instrumentation for Rust code would be necessary but this doesn't involve doing the whole compiler on, say, an 8-bitter.
"you don't have to write a whole new compiler from scratch, unless you're worried about "trusting trust" attacks."
That's an SCM security problem. You'd need to trust every compiler developer, the repo it's stored in, the transmission process, and whatever you used to build it. Most supposed solutions focus on the last one almost exclusively when the first three were the source of most attacks historically. In any case, that's barely relevant to the discussion of using Rust on a new architecture as almost nobody will every be hit by that & most people wanting Rust backends aren't doing high-assurance security for stopping nation-states or something. Those people hand-verify the assembly anyway.
The first three aren't a "trusting trust" attack. With the first three, any attack is visible in the code that you eventually compile. The whole point of "trusting trust" is no amount of source code inspection will ever uncover the problem.
Plus, Karger pointed out solution shortly after the problem: verified compiler, safe languages, repo security (esp paper in safes), crypto/courier distribution, and designed to build locally from source using onsite tools rerunning all tests, proofs, etc. Mitigates the need for worrying about Trusting Trust most of the time plus knocks out majority of attacks. Better to mention that if worried about subversion. Or Myer's landmark work that defined in detail problems and solutions.
Trusting Trust meme just misdirects focus from important issues.
But the person who did said
> you don't have to write a whole new compiler from scratch, unless you're worried about "trusting trust" attacks.
The point of that comment (at least, as I read it) isn't that you have to be worried about "trusting trust", but rather that there's no point in writing a new compiler from scratch unless you already are worried about "trusting trust" (with the implication being that most people aren't and so writing a new compiler from scratch isn't necessary).
SCM security issues (as you mentioned) are irrelevant at this point, because they really have no bearing on whether you have to write a new compiler from scratch.
[1]: https://www.ieee-security.org/TC/SP2016/papers/0824a018.pdf
So that leaves just independence, which you solved right in your comment: use an existing compiler with a new backend to cross-compile itself. If your compiler is portable this still means the only thing you need to write is the new backend.
Maybe one written in C89 that has its own backends for various archs. It would be less-focused on optimization and more on portability.
x86_64-mscv
x86_64-osx
x86_64-linux
armv7-android
i686-android
arm-linux-hf
armv7-linux-hf
Aside from needing a linker per-platform rustup takes care of all the LLVM stuff, it's really much simpler that I thought it would be.But there are literally billions of 8bit and 16bit embedded systems out there, many of which have a C compiler.
http://www.atmel.com/Images/45107A-Choosing-a-MCU-Fredriksen...
http://www.embeddedinsights.com/channels/2010/12/10/consider...
Far as future, Jack Ganssle of The Embedded Muse has a nice assessment of it summarizing various sides:
https://juliacomputing.com/blog/2016/03/10/j2c-announcement....
I have high hopes for something like https://github.com/thepowersgang/mrustc
C wasn't that portable in the 80's and 90's, with all its flavous across CP/M, MS-DOS, 8-bit home micros, mainframes, ...
Bootstrapping Rust is hard, doing the same for C is simple. I could create a simple C compiler just to bootstrap the real C compiler, something I have actually done once or twice before. That's not something you do with Rust, at least from the limited experience I have with Rust.