NEW BLOGPOST: Why am I writing a #Rust #Rustlang compiler in C?
Conversation
Notices
-
Embed this notice
notgull (notgull@hachyderm.io)'s status on Monday, 26-Aug-2024 05:39:37 JST notgull -
Embed this notice
Daniel Paoliello :rust: (tehpenguin@hachyderm.io)'s status on Monday, 26-Aug-2024 05:39:49 JST Daniel Paoliello :rust: @notgull "Which is fine for us users, since we can just download rustc from the internet and use it."
Yeah, some of us don't have the luxury of downloading and running arbitrary unsigned binaries from the internet. Makes the security folks nervous for some reason...
Glad to see that this is coming along! I'm excited for another way to bootstrap Rust.
Haelwenn /элвэн/ :triskell: likes this. -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Monday, 26-Aug-2024 06:10:33 JST Haelwenn /элвэн/ :triskell: @notgull @lord Also given how Rust works, it's not just the CPU architecture but also the OS and libc.
So for systems like Alpine they got it cross-compiled from another system, horrible in terms of reproducibility. -
Embed this notice
notgull (notgull@hachyderm.io)'s status on Monday, 26-Aug-2024 06:10:34 JST notgull @lord Well, yes they would. But who compiles that compiler? And then, who compiles *that* compiler?
It has to start somewhere. My goal is to create a better starting point.
-
Embed this notice
Lord (lord@pleroma.lord.re)'s status on Monday, 26-Aug-2024 06:10:36 JST Lord @notgull Don't distros would use a precompiled static binary compiler ? (honest question, i'm not snarky at all. I'm not even a coder, i find it very intriguing)
-
Embed this notice
notgull (notgull@hachyderm.io)'s status on Monday, 26-Aug-2024 06:10:37 JST notgull @lord First of all, there are definitely some new CPU architectures in the works. RISC-V is still recent.
Another use case (and my motivating one) is for distros who want to have a direct bootstrap chain for all binaries they serve.
-
Embed this notice
Lord (lord@pleroma.lord.re)'s status on Monday, 26-Aug-2024 06:10:38 JST Lord @notgull Is there really a point in bootstrapping now ? Isn't it useful only when a new CPU architecture arrive and you want to have all those languages on there ?
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Monday, 26-Aug-2024 06:15:46 JST Haelwenn /элвэн/ :triskell: @lord @notgull Yeah, in a way bootstrapping is a soft-dependency of reproducibility. -
Embed this notice
Lord (lord@pleroma.lord.re)'s status on Monday, 26-Aug-2024 06:15:48 JST Lord @lanodan @notgull Hooo i see for reproducibility it makes sense too :-)
-
Embed this notice
William D. Jones (cr1901@mastodon.social)'s status on Monday, 26-Aug-2024 06:21:03 JST William D. Jones @notgull How is Rust's LLVM dep being handled? Don't get me wrong, I would love to get rid of it, just based on the fact it's 10 million lines of C++, arguably the only language more complex to write a compiler for than Rust. But we don't have that luxury :/.
-
Embed this notice
notgull (notgull@hachyderm.io)'s status on Monday, 26-Aug-2024 06:21:03 JST notgull @cr1901 My plan is to replace it with the Cranelift backend. It's written entirely in Rust, so it should be usable if we have a Rust compiler.
If that doesn't work, my plan is to write a QBE backend for rustc and use that instead.
Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice