4 ms·
Probably none I'd guess. The embedded space really loves C simply because it's viewed (usually wrongly) as more deterministic than C++ but there are a lot of i
by AWildC182 8y ago
Probably none I'd guess. The embedded space really loves C simply because it's viewed (usually wrongly) as more deterministic than C++ but there are a lot of instances where C is not a good choice (when you no-shit need objects) so they come up with abstractions for common things (terrifying C patterns). Rust has a lot of features that C lacks so we probably won't need to do any abstraction for now.
- pjmlp 8y agoNot only that, they also love to deploy with optimizations turned off to avoid any compiler magic, so you end up with some convoluted hand written code, which could otherwise be written by the compiler itself.
- vanderZwan 8y agoWhy do you say none, then immediately list a few advantages of Rust? To build on your points: - it might be a easier language to target with a compiler because it's a higher-level intermediate language - there would be fewer undefined behavior shenanigans - successfully writing a compiler that targets Rust without using unsafe (too much) would mean getting (some of) the safety benefits as a side-effect. Could especially be relevant for languages aiming to introduce zero-overhead safety to the embedded environment themselves - regarding previous point: discovering bugs in the process of porting to Rust - because Rust plays relatively nicely with C and C++, one wouldn't have to lose existing libraries along the way
- AWildC182 8y agoI'm saying "None" in response to needing compilers that compile to Rust, not to rust itself. Basically to boil down my argument, we don't need to compile to Rust instead of C because simply replacing C with Rust should be sufficient. People made "compiles to C" languages because C was not capable of doing everything they wanted easily.
- vanderZwan 8y agoAaah, I see where you are coming from. Yes, that is a good point. Porting a compiler could still be useful for the sake of legacy code though.
- gpderetta 8y agoIt seems to me that writing a compiler that can target safe rust would be extremely hard with little benefit.