2 ms·
> I've used C++ in a pretty tight embedded environment and it was great. I'd love to hear some details. I'm always looking for C++ stories that didn't end in
by bsder 7y ago
> I've used C++ in a pretty tight embedded environment and it was great.
I'd love to hear some details. I'm always looking for C++ stories that didn't end in disaster and what the people did that worked.
- com2kid 7y agoI've done similar. The Microsoft Band UI was written in C++. No templates or other advanced features, compiler was stuck on 2003 standard. We had templates but used the trick of implementing them in a .cpp file and declaring all the instanciations of them we'd ever use at the bottom of the same file. Had to write our own to guarantee 0 allocs. It is quite do-able. Lots of static declarations, basically write C with classes. V-tables ended up being non-trivial in size, but what can you do, GUIs and all that. Possibly the best (only?) good use of inheritance hierarchies. 256KB memory, the UI only had 60KB or so available for it IIRC. We also had a scratch pad available over a super slow bus of a couple megs, but it couldn't be used too much or we'd drop frames and we loved our 30fps v-sync'd performance.
- dragontamer 7y agoPretty much any CUDA programmer can talk about how they got 1024 threads working on 64kB "shared memory" with their C++ compiler. That "shared memory" region is exceptionally fast, so its a good idea to hyper-optimize your memory accesses to use that region. There are some very interesting constraints in GPU-programming. Fitting C++ classes and even some data-structures in the "shared memory" region is pretty nifty.