5 ms·
Python is great for simulating, processing data, providing an interface to automation control, but I'd still use C++ for anything time critical. With more recen
by TYPE_FASTER 10y ago
Python is great for simulating, processing data, providing an interface to automation control, but I'd still use C++ for anything time critical. With more recent versions of the standard and Boost, you can be quite productive with C++ without giving up much in the way of runtime performance.
- StavrosK 10y agoI don't know C++, so take this with a grain of salt, but I'd rather use Rust for those things right now. The problem with the embedded landscape right now (I mean really embedded, not MCUs that run Linux) is that tooling around using unrelated libraries isn't very good. I use PlatformIO for managing dependencies, but generic libraries that aren't exclusive to embedded programming aren't in the repositories. In general, if you want to add a library, you unzip it into a directory and pretty much never update. I find development with C/C++ much more painful than with Python, when most of the time I just want the thing to work, not to spend two hours writing boilerplate.
- alfalfasprout 10y agoI'm actually very surprised with modern (C++11/14) you're having to write so much boilerplate. I actually find I spend more time tracking down weird bugs in Python (that only show up at runtime) than I do with C++. Especially with great static analyzers.
- c0rtex 10y agoWhat static analyzers do you use for your embedded C++ work?
- samfisher83 10y agoWhen you do embedded you have to deal things like memory mapped IO, setting up pointers for various devices and stuff like that. How do you expect to that with python?
- JoachimSchipper 10y agoErm, Rust-as-designed may or may not be suited for embedded, but Rust-as-it-is-now has some nasty limitations - not the least of which is the lack of support for anything that is not ARM.
- StavrosK 10y agoSorry, I meant "now that Rust exists", not "as tooling currently is".
- steveklabnik 10y ago> not the least of which is the lack of support for anything that is not ARM. This might be true with regards to embedded architectures, but isn't in general; MIPS and PowerPC are in tree, and we can fundamentally support anything LLVM can, there's just the initial work to get it going. Which platforms are most important to you?
- StavrosK 10y agoIt's too bad that nobody is replying to you. Personally, I would be over the moon if I could develop for the ESP8266 in Rust, but that might be a tall order, since it's a very small chip.
- steveklabnik 10y agoFunny enough, when researching this, https://news.ycombinator.com/item?id=9573390 https://news.ycombinator.com/item?id=9573390 It seems like a lot of people are interested in this, but there isn't an LLVM backend yet. There is someone working on a Rust -> C transpiler, so if that matures enough...
- 0xffff2 10y ago>I don't know C++, so take this with a grain of salt, but I'd rather use Rust for those things right now. Right now? Do you do any embedded development at all? In principle, I would love to ditch C++ in favor of Rust forever, but in practice Rust isn't anywhere near "there" yet in terms of tooling and platform support.
- steveklabnik 10y agoFor my own survey purposes, which platforms are important to you?
- alfalfasprout 10y agoC++ on embedded is a godsend. It's so much easier to be productive, the code looks much cleaner, etc. At this point, static analyzers and compilers are also pretty good at catching the most common issues. Too bad many embedded compilers don't support all of the latest features.