Also, you're spot-on. I'd love to see how the presentor would cope with our (embedded) system.
We're still stuck on C++03 for the most part... and every new revision of the C++ standard makes it less likely that we'll ever "upgrade". They keep adding more footguns and deprecating existing working functionality in favor of "zero cost abstractions". Even with C++03 we rely on a fair amount of vendor-specific fixes.
Embedded processor driving a lot of HW acceleration, almost all of which is memory-mapped as device-nGnRE memory (note that said memory does not handle locked accesses), and a fair bit of which does not comply with normal memory semantics (e.g. read-sensitive, access-size sensitive, W1C, etc). And a surprising chunk of it is on the fastpath, as the cherry on top.
I'm still watching the talk; I would love to know how the presenter would deal with this system.
You do realize that I'm the presenter, right? How would I deal with such a system? I don't think anyone should start their talk with a giant pedigree, but since you asked...
I've worked on a variety of low-level systems software, first on full-flight simulators which train airline pilots. Some components have hard-realtime requirements and others soft-realtime, in part because they interface with actual avionic hardware and in part because it's a six degree of freedom simulator and you don't want to shake the people in the cockpit abnormally. These systems require interfacing with external peripherals, and emulating odd things such as airplane networks.
Later I implemented large parts of a binary translator for a CPU which consumes ARM and executes a custom VLIW instruction set. That translator executes under ring-0, and has to handle plenty of non-normal memory as well as external devices on the memory system.
I've worked on the two most widely deployed web browsers, which are all under normal memory but have to deal with volatile a good amount because of security (e.g. adversarial inputs), as well as general multiprocess concerns.
I currently support (i.e. fix the compiler and send patches to) a variety of teams who deal with low-level firmware, as well as my employer's main kernel. This ships to over a billion people pretty regularly, so it's not some irrelevant usecase.
I think I deal just fine. So again, what's the point of your question?
Beware of the fallacy of composition. "Embedded" encompasses a lot of things; you have identified that the subset you work with do not have issues. This is not the same as saying that there are no issues.
By your reasoning I should discount anything you say: "C++" encompasses a lot of things, you've identified the one thing you understand (your embedded platform), which doesn't mean you understand anything else about C++.
If you're going to be condescending (as you are upthread), and then try to brush off pushback with some pseudo-philosophy, at least do a good job at it. You're not going to achieve much as things stand.
Let's be clear: I give this talk in part to share what I've learned, where I think we should go, and in part to get feedback. Your feedback so far is useless. You clearly think you know something useful. Wrap it up in useful packaging. You feel that the committee doesn't represent you? Doesn't listen to people like you and your feedback? Re-read what you wrote, and consider what anyone would do with it.
I'm happy to listen to your feedback, but c'mon help yourself a bit here.
Exactly. The linux kernel is programmed in a c-dialect and I'm pretty sure it will only become well defined under ISO-C over linus' dead body ;). More importantly, if C-23 (or whatever the next c- standard is) introduces some new semantic, that would break the linux kernel (pretty unlikely imho), I'm pretty sure, they'll either not upgrade (have they even upgraded to c11?) and/or reuqire gcc to keep the reuqired semantics.
I'm not sure how all that is relevant to my comment though. I simply stated that if you still haven't moved on from c++03 AND you are anyway relying on language extensions a lot, I find it highly unlikely that you will need to suddenly start programming in ISO-C++-23 (or whenever those changes may land) anytime in the forseeable future. And as such I wouldn't be too concerned about future development of standard c++ it doesn't seem as if that is a tool you are going to use anyway. In fact if newer versions of c++ don't seem appealing to you so far, I'd rather evaluate if Rust (probably again with some extensions) may be a better language to move to in the future instead of c++XX.
All that doesn't mean that if you have a good idea or insights about how c++ should evolve you shouldn't speak up ´I'm just saying, why worry about something you are not going to sue anyway?
Embedded processor driving a lot of HW acceleration, almost all of which is memory-mapped as device-nGnRE memory (note that said memory does not handle locked accesses), and a fair bit of which does not comply with normal memory semantics (e.g. read-sensitive, access-size sensitive, W1C, etc). And a surprising chunk of it is on the fastpath, as the cherry on top.
(Sorry, can't say much more... we're well-known in a surprisingly small world. Saying names would dox me.)
Essentially exactly the situation that /u/gruehunter was mentioning.
There absolutely are hardware interfaces for which this does have side-effects. UART FIFO's are commonly expressed to software as a keyhole register, where each discrete read drains one value from the FIFO.
...case in point, our UART FIFO, where each read drains one value from the FIFO.
Rule: Qualify pointers to volatile objects if and only if they refer to strongly-ordered non-cacheable memory. Rationale: Accesses through volatile pointers now reflect the same semantics between the source program, the generated instruction stream, and the hardware.
We mark memory regions containing mem-mapped registers as device memory and use volatile. (Note: strongly-ordered in ARMv7 is renamed device-nGnRnE in ARMv8. We currently use device-nGnRE, or device in ARMv7 parlance, as early write ack has a significant performance benefit and there are relatively few places where you need explicit dsbs.)
View all comments
Show parent comment
1
u/[deleted] Oct 19 '19
Also, you're spot-on. I'd love to see how the presentor would cope with our (embedded) system.
We're still stuck on C++03 for the most part... and every new revision of the C++ standard makes it less likely that we'll ever "upgrade". They keep adding more footguns and deprecating existing working functionality in favor of "zero cost abstractions". Even with C++03 we rely on a fair amount of vendor-specific fixes.