Live data from Hacker News

Translating All C to Rust (TRACTOR)

darpa.mil

11–20 of 403 posts

Re: Translating All C to Rust (TRACTOR)

#11

The one link for those who think that 'Rewrite it All in Rust' will, well, settle any debates: https://github.com/rust-lang/miri/

Genuine question: Would you mind explaining to a dev that doesn’t know much (anything) about Rust, how does this settle any debate?

From the original post > It’s not enough to rely on bug-finding tools

From the Miri github: > Miri is an Undefined Behavior detection tool for Rust.

Re: Translating All C to Rust (TRACTOR)

#12
post #8
post #7

Earlier quoted context omitted.

You linked an interpreter for some kind of internal compiler representation that the Rust compiler uses. What on Earth do you mean?

It's the old trope that some Rust code uses unsafe blocks so all Rust code is as unsafe as C.

Of course. I should have expected the Nirvana Fallacy. :)

Re: Translating All C to Rust (TRACTOR)

#15

The one link for those who think that 'Rewrite it All in Rust' will, well, settle any debates: https://github.com/rust-lang/miri/

Genuine question: Would you mind explaining to a dev that doesn’t know much (anything) about Rust, how does this settle any debate?

Well, the general 'Rewrite All in Rust' consensus is that it solves all general programming problems, ever.

Yet, the linked repository shows a huge list of cases in which simple, documented use of Rust can cause Undefined Behavior (a.k.a. 'UB')

Pretty much every argument of Rust advocates against C/C++ boils down to either 'but memory safety' or 'but UB'.

Yet there are many convincing counter-arguments that boil down to 'but CompCert' or similar, and, as the linked repository shows, there might be at least some truth in there?

Re: Translating All C to Rust (TRACTOR)

#16
post #8
post #7

Earlier quoted context omitted.

You linked an interpreter for some kind of internal compiler representation that the Rust compiler uses. What on Earth do you mean?

It's the old trope that some Rust code uses unsafe blocks so all Rust code is as unsafe as C.

I don’t know Rust but even if the Rust is just as unsafe in certain blocks, simply being translated to Rust removes a lot of corporate resistance to adopt the language.

Getting people to adopt a new language can be a lot of work. I remember people claiming they missed headers files in Swift so they wanted to stick with Objective C.

Re: Translating All C to Rust (TRACTOR)

#17

Earlier quoted context omitted.

Genuine question: Would you mind explaining to a dev that doesn’t know much (anything) about Rust, how does this settle any debate?

From the original post > It’s not enough to rely on bug-finding tools From the Miri github: > Miri is an Undefined Behavior detection tool for Rust.

Darpa is already ahead of you all with the hedging:

> The preferred approach is to use “safe” programming languages

“Safe”. Terms and conditions may apply.

Re: Translating All C to Rust (TRACTOR)

#18
post #7

The one link for those who think that 'Rewrite it All in Rust' will, well, settle any debates: https://github.com/rust-lang/miri/

You linked an interpreter for some kind of internal compiler representation that the Rust compiler uses. What on Earth do you mean?

> What on Earth do you mean?

That documented use of safe Rust can easily lead to UB, which this infernal 'internal compiler representation' demonstrates.

I'm not even sure what is even remotely confusing about that?

Re: Translating All C to Rust (TRACTOR)

#19

Earlier quoted context omitted.

Genuine question: Would you mind explaining to a dev that doesn’t know much (anything) about Rust, how does this settle any debate?

From the original post > It’s not enough to rely on bug-finding tools From the Miri github: > Miri is an Undefined Behavior detection tool for Rust.

There is no contradiction. The fact that UB-finding tools alone are not sufficient doesn't mean they aren't useful even with a safe(r) language.

In other words, from "safer languages are necessary" it does not follow that "safer languages are sufficient".

Re: Translating All C to Rust (TRACTOR)

#20
post #7

Earlier quoted context omitted.

You linked an interpreter for some kind of internal compiler representation that the Rust compiler uses. What on Earth do you mean?

> What on Earth do you mean? That documented use of safe Rust can easily lead to UB, which this infernal 'internal compiler representation' demonstrates. I'm not even sure what is even remotely confusing about that?

Miri is a MIR interpreter aimed at unsafe Rust, not safe Rust. Using the fact that it operats on an internal representation is a very weird swipe; almost all static and dynamic analysis tools work on some kind of IR or decomposed program representation.
Post reply on HN