TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bootstrapping Rust

194 pointsby darnirover 6 years ago

5 comments

rusbusover 6 years ago
The &quot;bootstrapable.org&quot; project that OP refers to is an interesting practical result from the infamous &quot;Reflections on Trusting Trust.&quot;[1] If you have the source compiler, which is itself bootstrapped from source, then you effectively sidestep the problem brought up in the paper -- someone sneaks in a boobytrapped compiler somewhere in the process resulting in a chain of tainted compilers.<p>This is the kind of work that seems pretty thankless, but I&#x27;m glad someone is doing it.<p>[1] <a href="https:&#x2F;&#x2F;www.archive.ece.cmu.edu&#x2F;~ganger&#x2F;712.fall02&#x2F;papers&#x2F;p761-thompson.pdf" rel="nofollow">https:&#x2F;&#x2F;www.archive.ece.cmu.edu&#x2F;~ganger&#x2F;712.fall02&#x2F;papers&#x2F;p7...</a>
评论 #18688601 未加载
评论 #18687571 未加载
评论 #18690733 未加载
yoklovover 6 years ago
&gt; There are plans to extend mrustc to support newer Rust, but it turned out to be difficult.<p>Was some feature added to rust 1.20.0 that was particularly difficult to implement? Or is this just a &#x27;have to stop somewhere&#x27; situation.
评论 #18687604 未加载
unhammerover 6 years ago
<a href="https:&#x2F;&#x2F;dwheeler.com&#x2F;trusting-trust&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dwheeler.com&#x2F;trusting-trust&#x2F;</a> is the page on Diverse Double-Compiling as a counter to the trusting trust attack
ximengover 6 years ago
So bootstrap chain here is g++-&gt;mrustc-&gt;several iterations of rust. (Rather than original bootstrap chain via ocaml.)<p>Bootstrap for g++ is presumably something like machine code-&gt;asm-&gt;c-&gt;g++.<p>And the overall goal is something like shortening or simplifying the chain from machine code to rust compiler.<p>Ideally I suppose this would be something like machine code-&gt;proto rust-&gt;rust compiler.<p>Haskell seems to have a relatively good pipeline, with clean division between core and non-core.<p><a href="https:&#x2F;&#x2F;ghc.haskell.org&#x2F;trac&#x2F;ghc&#x2F;wiki&#x2F;Commentary" rel="nofollow">https:&#x2F;&#x2F;ghc.haskell.org&#x2F;trac&#x2F;ghc&#x2F;wiki&#x2F;Commentary</a>
评论 #18688205 未加载
评论 #18687499 未加载
评论 #18687561 未加载
评论 #18687530 未加载
评论 #18688403 未加载
andrewchambersover 6 years ago
writing mrustc in C++ seems like such a mistake.<p>It compiles rust to C, so why not write it in rust? then compile itself to C.<p>Another idea, just compile rustc to web assembly then use <a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;wabt&#x2F;tree&#x2F;master&#x2F;wasm2c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;wabt&#x2F;tree&#x2F;master&#x2F;wasm2c</a> to convert it to your bootstrap source.
评论 #18688664 未加载