3 ms·
What does it mean for something to be able to compile itself?
by TedDoesntTalk 4y ago
What does it mean for something to be able to compile itself?
- LoganDark 4y agoIt means that the compiled binary can be used to compile updated versions of its own source code, so you no longer need to keep around a secondary compiler for that purpose. This is known as "self-hosting"[0], and is typically a desirable property of compilers that target their own runtime environment. [0]: https://en.wikipedia.org/wiki/Self-hosting_(compilers) https://en.wikipedia.org/wiki/Self-hosting_(compilers)
- pabs3 4y agoUnfortunately self-hosting breaks the ability to bootstrap solely from source code, so it is usually recommended to keep that secondary compiler working (or included it as part of the build process for your compiler) so you can trust the compiler binaries aren't tampered with. https://bootstrappable.org/ https://bootstrappable.org/
- LoganDark 4y ago> so you can trust the compiler binaries aren't tampered with. Hehe, I love reflections on trusting trust~
- dmytrish 4y agoFor the record: C* is a subset of C. Selfie is trivially bootstrapple by any C compiler. Moreover, it's very easy to implement the subset of RISC-V used by Selfie if you don't trust its emulator. Bootstrapping vs self-hosting is a false dichotomy here.
- pabs3 4y agoGood to hear. Usually self-hosting means the maintainers will drop bootstrapping, thanks for being the exception to that rule. If you aren't verifying bootstrapping works in your CI, it might be worth adding that.
- defrost 4y agoSufficiently "self aware" to be able to propagate forward a back door exploit that no longer needs to apear in the source code being compiled [1]. [1] http://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf http://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Refl...