Live data from Hacker News

Translating All C to Rust (TRACTOR)

darpa.mil

1–10 of 403 posts

Re: Translating All C to Rust (TRACTOR)

#5

See also https://sam.gov/opp/1e45d648886b4e9ca91890285af77eb7/view

Direct link to Proposer's Day info [PDF]: https://sam.gov/api/prod/opps/v3/opportunities/resources/fil...

"The purpose of this event is to provide information on the TRACTOR technical goals and challenges, address questions from potential proposers, and provide an opportunity for potential proposers to consider how their research may align with the TRACTOR program objectives."

Re: Translating All C to Rust (TRACTOR)

#6

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?

Re: Translating All C to Rust (TRACTOR)

#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?

Re: Translating All C to Rust (TRACTOR)

#8
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?

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

Re: Translating All C to Rust (TRACTOR)

#9

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?

I believe it goes something like, "I have constructed a strawman that Rust claims that all code written in it is automatically safe by all conceivable definitions of safe, but look, ha ha, here's something that detects unsafe code in Rust!", and I don't mean "code marked in unsafe blocks".

It's a concatenation of several logical fallacies in a row; equivocation, straw manning, binary thinking about safety, several others. It's hard to pick the main one, but I'd go with the dominant problem being a serious case of binary thinking about what "safety" is. Of course, if the commentor is using anything other than Idris for all their programming, they're probably not actually acting on their own accusations.

Re: Translating All C to Rust (TRACTOR)

#10
That sounds ... hard. Especially as idiomatic Rust as written by skilled programmers looks nothing like C, and most interesting code is written in C++ anyway.

Isn't it equivalent to statically determining the lifetimes of all allocations in the C program, including those that are implemented using custom allocators or which cross into proprietary libraries? There's been a lot of research into this sort of thing over the years without much success. C/C++ programs can do things like tie allocation lifetimes to what buttons a user clicks, without ref counting or other mechanisms to ensure safety. It's not a good idea, but, they can do it.

The other obvious problem with trying to write such a static analysis is that the programs you're analyzing are by definition buggy and the lifetimes might not make sense (if they did, they wouldn't have memory safety holes and wouldn't need to be replaced). The only research I've seen on this problem of statically detecting what lifetimes should be does assume the code being analyzed is actually correct to begin with. I guess you could try and aim for a program that detects where lifetimes can't be worked out and asks the developer for help though.

Post reply on HN