this fractalfir person is super talented. See them on the rust reddit all the time. I'm not knowledgeable on compilers at all but others seem to really like their work.
"Most components of std are about 95% working in .NET, and 80% working in C."
.NET
Core tests 1662 39 12 97.02%
C
Core tests 1419 294 82.83%
Missing from HN title: The "95%" pass rate only applies to .NET. For GCC/Clang it is only "80%".
Lots of interesting use cases for this. First one that comes to mind is better interop with other languages, like Python.
Nim to C compiler, 100% test pass rate.
Is it LLVM IR --> C? Or Rust AST to C?
But does it carry the Rusty guarantees?
Rust to C? Why would someone do that. Just write C.. if you can figure rust out you surely can figure C out and be proficient.
Very cool. C to Rust would be fantastic.
At first I read it as C to rust compiler.
What is the point of compiling rust to C?
Excellent.
Now we can quickly re-rustify projects by converting them to C.
If I see something like "At least on Linux, long and long long are both 64 bits in size." my skin starts to crawl. Not only that, but GCC defines __builtin_popcount() with unsigned int / long / long long, respective, i.e. even in the text it should be mentioned correctly (unless a different compiler uses signed types there ... ugh). The call is done with unsigned, using uint64_t as a type-cast, but using a fixed __builtin_popcountl() which translates to unsigned long. There are systems where this will fail, i.e. the only safe bet to use here is __builtin_popcountll() as this will cover at least 64 bit wide arguments.
Also, if a * b overflows within the result type, it is an undefined behavior according to the C standard, so this overflow check is at least not properly portable, either, and the shown code for that is actually buggy because the last A1 has to be A0.
No idea why all that gets me so grumpy today ...
[dead]
Why would I use a tool that doesn't pass all tests?
Would it be possible for Rust to output LLVM IR? Would that make it easier to port if they have a LLVM frontend?
Of course, everyone votes up the headlines, but this link seems like premature WIP. Hopefully this will get posted for real after the presentation.
I'm not convinced that it’s worth spending any time supporting most proprietary systems. Maybe not even Windows, but especially the really expensive ones.
How is this not dangerous? How can one be assured that all of the compile-time safety features of the Rust compiler are still in effect? Handwaving does not help.
I am still waiting for any of the alternative Rust front- or backends to allow me to bootstrap Rust on alpha, hppa, m68k and sh4 which are still lacking Rust support.
Originally, the rustc_codegen_gcc project made this promise but never fulfilled it.