2 ms·
For bootstrapping it still feels weird to target C. You could easily target a higher level language or just invent a better language. You don't care about runti
by IshKebab 2y ago
For bootstrapping it still feels weird to target C. You could easily target a higher level language or just invent a better language. You don't care about runtime performance. Feels like you don't really gain that much by forcing yourself to jump through the C hoop, and the cost of having to write an entire compiler in C is huge.
Like, how hard would it be to go via Java instead? I bet you can bootstrap to Java very easily.
- ronsor 2y agoEvery platform, for better or worse, gets a C compiler first. Targeting C is the most practical option.
- cozzyd 2y agoRight, but once you have C it's fairly straightforward to use an interpreted language implemented in C (python, perl, guile, lua, whatever). Obviously such a compiler would likely be unusably slow, but that's not important here.
- trueismywork 2y agoYou overestimate the comprehensiveness of C standard with half the things being optional. It's not given that python will compile on a minimal comforming C compiler.
- syntheticnature 2y agoI'd expect it to be harder. I used to work on a large embedded device that ran some Java code, and there was a specialist vendor providing Java for the offbeat processor platform. After a little digging, I found a blog post about it, and it does sound denser than the poster's plans to bootstrap Rust: https://www.chainguard.dev/unchained/fully-bootstrapping-java-from-source-in-wolfi https://www.chainguard.dev/unchained/fully-bootstrapping-jav...
- fsckboy 2y ago>feels weird to target C he's not targeting C, he's targeting rust; he's using C it's an important distinction, because he's not writing the C compilers involved, he's leveraging them to compile his target rust compiler which will be used to compile a rust-on-rust compiler. The C compiler is the compiler he has available, any other solution he would have to write that compiler, but his target is rust.
- IshKebab 2y agoTargeting C as the language to write his Rust compiler in. You knew that.
- fsckboy 2y agoi explained the distinction, i explained why it matters, in great detail, and OP explained it also, sorry you still don't know that. if he "targetted rust" the way you and GP are using it, he would have to duplicate the entire bootstrappable project as his target (my usage)