4 ms·
QNX is also realtime. In order to provide realtime guarantees that cover small latencies, you need infrastructure that generates as few instructions as possibl
by i336_ 9y ago
QNX is also realtime.
In order to provide realtime guarantees that cover small latencies, you need infrastructure that generates as few instructions as possible. (If you have lots of instructions you can hit targets of a hundreds of microseconds since you can just wait. Start inching toward nanoseconds, though, and the scheduler's own execution will get in the way unless it's crazy compact.)
The reason I mention this is that QNX runs on a variety of embedded devices (http://qnx.symmetry.com.au/ http://qnx.symmetry.com.au/ has an interesting list, universal remotes particularly jumped out at me) which are traditionally quite slow.
What's Rust like in terms of generating code that's consistently compact?
- mafribe 9y agoWhat's Rust like in ... Isn't that less a question of Rust (which due to its affine types, should be usable for generating code with predictable performance) but of compilers? It should be possible to write a Rust compiler that optimises for predictable performance at the cost of speed.
- i336_ 9y agoThat's a fair point. I don't quite follow why speed needs to be sacrificed to get predictable performance though. And I don't know about writing a (whole new?!) Rust compiler (!) - if the current Rust compiler wouldn't be a good fit for this purpose, well, I definitely don't have the resources to anything about that, considering the unbelievable amount of attention to detail and wrangling that's gone into getting rustc to where it is today.
- mafribe 9y agoEverything you say is true, but a very simple compiler with little/no optimisations should be quite easy to write. Indeed it is often coursework in undergraduate compilers courses (for source languages simpler than Rust). The main difficult would be the type-checker, but you could reuse the existing one, for it does not affect run-time performance.