2 ms·
Even assuming the existing code is high quality, there is still a lot of problems with pointer ownership and type checking which Rust removes. Personally I thi
by antoinealb 11y ago
Even assuming the existing code is high quality, there is still a lot of problems with pointer ownership and type checking which Rust removes.
Personally I think the best way is to wrap existing C code into higher level, safer Rust APIs.
- elcritch 11y agoExactly, even the most disciplined code base will have errors. Rust type system "automates" the process that many well designed C code bases will do by convention (e.g. borrowing and keeping ownership localised). While wrapping C libraries in safer Rust APIs is useful for many application, having something as fundamental as time-sharing, task interruption, etc would be much better if written in Rust and care is taken to define simple semantics for the system (e.g. like the recent HN post regarding state-machine based asynchronous IO in Rust).