News for hackers. Stuff that matters.
Re:Corrode: C to Rust translator written in Haskell by Animats on Friday July 08, 2016 @03:44PM (#12058137)
It transliterates C to Rust all right, but the Rust isn't any safer than the C that goes in. Note the representation of an null-terminated string - it's an unsafe pointer to a byte. That's what it was in C, transliterated unsafely to Rust. Some safe Rust representation for C arrays is needed.

From the description of how it translates a FOR loop, it does so by compiling it down to the primitive operations and tests. A Rust FOR loop does not emerge. That needs idiom recognition for the common cases including, at least, "for (i=0; i<n; i++) {...}".

This is a big job, but it's good someone started on it.

Re:Corrode: C to Rust translator written in Haskell by lemming on Saturday July 09, 2016 @01:12AM (#12060200)
This is explained in the readme:

A Rust module that exactly captures the semantics of a C source file is a Rust module that doesn't look very much like Rust. ;-) I would like to build a companion tool which rewrites parts of a valid Rust program in ways that have the same result but make use of Rust idioms. I think it should be separate from this tool because I expect it to be useful for other folks, not just users of Corrode. I propose to call that program "idiomatic", and I think it should be written in Rust using the Rust AST from syntex_syntax.

Re:Corrode: C to Rust translator written in Haskell by the8472 on Friday July 08, 2016 @10:41PM (#12059831)
couldn't that be a more general 2nd pass. rust -> rust?