Live data from Hacker News

Retrobootstrapping Rust for some reason

graydon2.dreamwidth.org

51–54 of 54 posts

Re: Retrobootstrapping Rust for some reason

#51

Earlier quoted context omitted.

Rust can selfbootstrap by compiling the rust code for the compiler.

> Rust can selfbootstrap by compiling the rust code for the compiler. Compiling the rust code for the compiler how ? The whole point is that we don't have rustc.

>The whole point is that we don't have rustc.

This is a made up restriction.

Re: Retrobootstrapping Rust for some reason

#52

Earlier quoted context omitted.

> Rust can selfbootstrap by compiling the rust code for the compiler. Compiling the rust code for the compiler how ? The whole point is that we don't have rustc.

>The whole point is that we don't have rustc. This is a made up restriction.

Okay, yes, if you declare the exercise pointless then you can skip it. That's not very interesting, though.

Re: Retrobootstrapping Rust for some reason

#53

Earlier quoted context omitted.

> Rust can selfbootstrap by compiling the rust code for the compiler. Compiling the rust code for the compiler how ? The whole point is that we don't have rustc.

>The whole point is that we don't have rustc. This is a made up restriction.

I think one of the reasons that we sometimes think about different ways of compiler bootstrapping is that someone decided to spend their Turing Award lecture on the topic.

Ken Thompson, "Reflections on Trusting Trust". https://dl.acm.org/doi/10.1145/358198.358210

Re: Retrobootstrapping Rust for some reason

#54

Earlier quoted context omitted.

No it can't. Not for RISC-V/musl, so I'm sure that must be true for other platforms too.

Once you've compiled it for one platform, you've re-bootstrapped it, at which point you can use the real compiler to cross-compile for another platform.

Ideally, you want more than one bootstrapped platform. Platforms eventually die, and you don't want to rely on an emulator for bootstrapping.

Some time from now x86_64 will fade away, and there's a large chance rust will still be around. I know that this will probably take a long time, but it's better and easier to do it now than later.

Post reply on HN