111
submitted 3 months ago by thomask to c/rust@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] JackbyDev@programming.dev 13 points 3 months ago

Didn't Rust itself used to have a compiler written in a different language? I mean, obviously it would've had to at some point but I think I remember reading about them abandoning it once they didn't need it. Why not use that?

[-] flying_sheep@lemmy.ml 14 points 3 months ago* (last edited 3 months ago)

If you had read the article, you'd know!

[-] underscores@lemmy.dbzer0.com 11 points 3 months ago* (last edited 1 week ago)

You can technically do it, but it's a convoluted path. The article talks about it. Basically to bootstrap that way you need to go through a lot of versions of rust, compile rust 0.7 in ocaml, compile ocaml in scheme, and compile scheme in C using gcc. For gcc you need to compile a chain of versions back to when it was written in C instead of C++, plus the whole TinyCC bootstrapping path.

edit: had listed scala instead of ocaml

[-] Giooschi@lemmy.world 7 points 3 months ago

compile rust 0.7 in scala

Not sure if there was another rewrite, but AFAIK (and the article agrees with me) rustc was originally written in Ocaml

[-] underscores@lemmy.dbzer0.com 1 points 3 months ago* (last edited 1 week ago)

Yeah, I wrote the wrong language. I tend to lump those together in my head as 'big multi-paradigm languages I haven't bothered to learn yet.'

[-] JackbyDev@programming.dev 5 points 3 months ago

Ah okay. The article was a little over my head so I mostly skimmed it. This makes sense what you're saying though. It's easy to forget the level of bootstrapping they're trying to do is all the way to assembly.

It's the sort of thing if you think about too long you'll get paranoid and start using Gentoo exclusively lol.

this post was submitted on 25 Aug 2024
111 points (97.4% liked)

Rust

6058 readers
57 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS