2 ms·
If not a standard, then at least a specification. This discussion is from 2020, so I'm not sure if it's still up to date: https://users.rust-lang.org/t/where-i
by rob74 4y ago
If not a standard, then at least a specification. This discussion is from 2020, so I'm not sure if it's still up to date:
https://users.rust-lang.org/t/where-is-the-rust-language-specification/42047 https://users.rust-lang.org/t/where-is-the-rust-language-spe...
"For the most part though, rustc itself is the spec" - so, for implementing the GCC frontend, read the current LLVM frontend really carefully and do everything the same way? And try to keep up with all the changes which will inevitably happen in the LLVM frontend while you are implementing the GCC frontend?
- b3morales 4y agoIntegration-style tests are a good tool here. Given a set of programs in the target language with certain expected behavior on the reference compiler, you check that compiling and running with the second compiler produces the same behavior.
- steveklabnik 4y ago> so, for implementing the GCC frontend, read the current LLVM frontend really carefully and do everything the same way? At a high level, this is correct: https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Questions#what-is-the-plan-for-inconsistencies-in-behaviour https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Ques... > If gccrs interprets a program differently from rustc, this is considered a bug. I don't believe they are only reading the frontend, but using the reference first, then looking to the implementation second, and asking a lot of questions along the way.