|
|
|
|
|
by fiedzia
3368 days ago
|
|
And is there any reason why Rust couldn't be as portable as the C code that makes up curl? In theory no, in practice yes. Rust is using LLVM project to generate machine code, and that only supports certain architectures. There are however other safe languages that can generate C, if this is a requirement. > Is it very difficult to transpile C into Rust? If safety guarantees could be added to C by some conversion or analysis, there would be no need for Rust to exist. Rust (and other languages with similar goals) is safer for many reasons, not limited to languages itself. Stdlib and runtime play their part too. Automatic conversion that takes all that into account is either impossible or impractical. There is a tool for converting C into unsafe Rust (corrode), which might be useful for people attempting to port C code, but in itself doesn't improve code safety at all. |
|