3 ms·
If you translate the code from C to Rust automatically. Isn't C still the source code? Just transpiled to Rust as an intermediate before asm?
by TZubiri 2y ago
If you translate the code from C to Rust automatically. Isn't C still the source code? Just transpiled to Rust as an intermediate before asm?
- rectang 2y agoIndeed. Think of the AI stage as “llmcc”, or maybe “lsdcc” if you want to emphasize the hallucination problem.
- Gibbon1 2y agoYeah. I'm not sure how transpiling to rust is that much different than using the various standard analysis tools. And back porting things like the counted by attribute. Also the lowest hanging fruit in C would be adding the ability to box and unbox fat pointers to objects.
- geor9e 2y agoThere's no direct translation back and forth between unsafe C to safe Rust tho, and theres infinite memory safe interpretations possible. If you're only interested in a black box executable, where certain tests pass, then I suppose you could just save the C and delete the Rust. But, the Rust has more information (that can't be deduced deterministically from the C). C would first get transpiled to unsafe Rust. Then some intelligence (A.I. or human) would get rid of all the unsafe keywords by making new design decisions that affect how the executable works inside. Each intelligence will do it differently. New edge case tests might give different outputs depending when you transpiled the C. It'd be better to save the Rust and make future changes without worrying if the latest A.I. will make the same design decisions at the prior A.I. each time you compile.