Live data from Hacker News

crustc: entirety of `rustc`, translated to C

github.com

71–80 of 99 posts

Re: crustc: entirety of `rustc`, translated to C

#71
There are discussions of round-trip between Rust and C;

Would this be useful for this too?

From https://news.ycombinator.com/item?id=46265855 :

> To better port C to Rust: 3C (Checked C), c2rust, Crown ownership analysis, RustMap, c2saferrust (LLM), Laertes

C -> Checked C -> Rust

Because Checked C will annotate the raw and other C pointers first.

Re: crustc: entirety of `rustc`, translated to C

#73
post #8

Have you tried Diverse Double-Compiling (DDC) to test if the official rust compiler has a backdoor? Use crustc to compile the rust source code, producing a new compiler. Then use this new compiler and the official rustc binary, both with deterministic flags, to compile the rust source code again. The two outputs should match bit for bit.

This reminds me of https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...

I'm also a fan of https://www.teamten.com/lawrence/writings/coding-machines/

Re: crustc: entirety of `rustc`, translated to C

#75
post #59

Rust is finally memory safe enough to become C

"You have become the very thing you swore to destroy"

The real salvation is assembly written software with a wordwide non-IP-locked ISA (for instance RISC-V). Then very high language interpreters would be written directly in such assembly.

Re: crustc: entirety of `rustc`, translated to C

#76

i believe the author is confused this is the wrong direction (jk i read the readme)

Nope, and c++ should get the same thing.

But we now all know rust is microsoft and c++ ISO. I don't think we can trust much more ISO than microsoft to produce less feature creep over the currently known planned obsolescence cycle of 5-10 years.

Re: crustc: entirety of `rustc`, translated to C

#77
post #52

Earlier quoted context omitted.

GTA VI out in Rust before C++?

Wake me up when consoles officially support Rust. Until then there's no real way around C/C++ if you want to publish a real game to real consoles. But there's https://akaganite.com so it might become possible soon™

They don’t need to “officially support” Rust in order to ship code written with Rust. Just target the applicable architecture and ABI. It’s a lot easier now that the ABI’s are mostly standard now too.

Source: I wrote a compiler and runtime that ran .NET code (AoT compiled with LLVM) on PS3/Xbox360/Wii and shipped a few games with it.

Re: crustc: entirety of `rustc`, translated to C

#78
post #39

Earlier quoted context omitted.

So the author made a Rust to C transpiler and immediately used it to transpile... the Rust compiler. I love it.

It makes sense as a porting tool, if you need to port the Rust compiler to some target that has a C compiler. But it doesn't mean rustc generates code for that target, only that you can run it there. You'd still have to teach LLVM about the target. Although that might already have been done. It's not that useful for retro computers because the Rust compiler needs too much memory for most machines of the 32-bit era.

As far as I know, ISO c++ is no better than microsoft rust.

It is said microsoft rust syntax is on the same brain damage complexity level than ISO c++. That, and I don't even talk about the technical cost of its runtime (not far from the toxicity of a jvm?)

Re: crustc: entirety of `rustc`, translated to C

#79
post #78
post #39

Earlier quoted context omitted.

It makes sense as a porting tool, if you need to port the Rust compiler to some target that has a C compiler. But it doesn't mean rustc generates code for that target, only that you can run it there. You'd still have to teach LLVM about the target. Although that might already have been done. It's not that useful for retro computers because the Rust compiler needs too much memory for most machines of the 32-bit era.

As far as I know, ISO c++ is no better than microsoft rust. It is said microsoft rust syntax is on the same brain damage complexity level than ISO c++. That, and I don't even talk about the technical cost of its runtime (not far from the toxicity of a jvm?)

What is Microsoft rust? I’ve never heard of such a thing. Or did I miss the joke?

Re: crustc: entirety of `rustc`, translated to C

#80
post #3

> I put my left hand in a blender. The blender won. (Still have all my fingers, just some stitches). I will not elaborate further. What a shame. I would've read an article about this.

Nobody who would code this up would be entirely sane. But I can't help thinking "these are my people" when I read this...

He wrote 14 Rust to C compilers. Sanity has gone out of the window already.
Post reply on HN