2 ms·
> how hard do folks think it would be to make a C -> Rust transpiler? Why do you want to do that? The only way to make it work short of doing years and years o
by pcwalton 11y ago
> how hard do folks think it would be to make a C -> Rust transpiler?
Why do you want to do that? The only way to make it work short of doing years and years of static analysis research to automatically translate ad-hoc memory management disciplines into those of Rust (that I think will not succeed anyway) would be to compile to unsafe code. And if you compiled to unsafe Rust code, there would be no gain.
- wspeirs 11y agoI'm not sure it would take "years and years" of static analysis research. You could use the data-flow analysis that is built into LLVM, then punt on the rest. It doesn't HAVE to produce Rust code that compiles 100% of the time. The goal would be to run it through the transpiler so you have a starting place to produce Rust code that compiles and works the same as the original C code. Again, this might be a terrible idea, but I'd be curious to hear from anyone that has experience with this sort of porting...
- pcwalton 11y agoData flow has nothing to do with the hard problems you'd have to solve.