Re:What can C++ do for embedded systems developers? [video]
by sbradford26 on Monday September 24, 2018 @09:49AM
(#18057633)
It is very interesting because directly states that for C++ to be as efficient you need to have the optimizer on. Now for most scenarios that makes perfect sense but for aerospace we need to be able to match the code directly between the assembly and C code. Without this it is incredibly difficult to do full verification.
[ Parent
| on HN ]
Re:What can C++ do for embedded systems developers? [video]
by klmr on Monday September 24, 2018 @11:06AM
(#18058283)
That’s true but for the most part such optimisations happen very predictably (and are extensively verified when applicable). This isn’t a case of writing some very abstract code and hoping that the compiler will sort it. Rather, you use abstractions that have been carefully designed and implemented (probably by you) to result in predictable machine code (another comment links to a good example of this by James Turner; the key here is that this example is obviously chosen for illustration purposes, but can be generalised). C++ does not relieve you of the responsibility to understand the abstractions you’re using, but it does make it possible to write such abstractions; for example, writing an iterator over a complex container type that, when used with a range-for loop, compiles down to a single inc/cmp/jne (this is in fact what a range-for loop over a `std::vector` does).
Optimisations in C++ (those that are relevant here, anyway) are something that need to be relied on to write efficient code, but they also can be relied on.
Re:What can C++ do for embedded systems developers? [video]
by fooker on Monday September 24, 2018 @10:15AM
(#18057814)
>Without this it is incredibly difficult to do full verification.
You can verify the optimizations on their own. Example: https://www.cs.utah.edu/~regehr/papers/pldi15.pdf
Re:What can C++ do for embedded systems developers? [video]
by gmueckl on Monday September 24, 2018 @11:10AM
(#18058314)
In the framework of safety-critical software correctness of the compiler is a prerequisite, but not seen as sufficient to prove the correctness of the actual translation.
Re:What can C++ do for embedded systems developers? [video]
by fooker on Monday September 24, 2018 @02:09PM
(#18059893)
Why?
Re:What can C++ do for embedded systems developers? [video]
by gmueckl on Monday September 24, 2018 @04:05PM
(#18060943)
Because the compiler is only correct if its execution environment is also correct. This cannot be guaranteed.
And also because the relevant standards say so.
Re:What can C++ do for embedded systems developers? [video]
by fooker on Monday September 24, 2018 @06:07PM
(#18061899)
Can you point me to these standards?
I do research in this field and it would be helpful to refer to such standards in papers.
Re:What can C++ do for embedded systems developers? [video]
by gmueckl on Monday September 24, 2018 @10:38PM
(#18063145)
For traceability you would need to look at Do-178C. I am currently not aware that ISO 61508 (general functional safety) and ISO 26262 (automotive functional safety) require traceability between source code and executable machine code.
All standards specify different levels of safety. Lower levels come with fewer requirements and are easier to implement, but are recognized as less reliable and therefore limited to less critical applications.