3 ms·
>> A C based rtos inherits all the difficulties present in C. Can you please expand on that, especially assuming(a big assumption) that the c code you're inter
by petra 11y ago
>> A C based rtos inherits all the difficulties present in C.
Can you please expand on that, especially assuming(a big assumption) that the c code you're interfacing is high quality , with rare bugs ?
- antoinealb 11y agoEven 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).