4 ms·
Embedded dev here. Using C/C++ for embedded systems external communications feels like building a house out of matches. Sure, there's tooling to help fire pro
by vardump 8y ago
Embedded dev here.
Using C/C++ for embedded systems external communications feels like building a house out of matches.
Sure, there's tooling to help fire proofing things a bit, like static analysis and so on. You see, it's important to spray some fire retardant on the match house.
But wouldn't it be so much nicer to have a construction material other than matches for this purpose...
- pjmlp 8y agoMaybe stuff like this? https://www.mikroe.com/mikropascal-pic32 https://www.mikroe.com/mikropascal-pic32 https://www.eclipse.org/community/eclipse_newsletter/2018/march/mita.php https://www.eclipse.org/community/eclipse_newsletter/2018/ma...
- taneq 8y agoIEC 61131-3 Structured Text [1] is very similar to Pascal if you're more on the industrial / electrical side rather than 'real' embedded dev, quite a few PLCs support it these days and it's a fair compromise between safety and expressiveness. [1] https://en.wikipedia.org/wiki/Structured_text https://en.wikipedia.org/wiki/Structured_text
- w_t_payne 8y agoAutoSAR? or Ada? Actually, does anyone know if FORTRAN is ever used for embedded applications?
- tjalfi 8y agoRTF/68k [0] is a extended Fortran 77 for embedded systems based on the 68k. It was used for a fair number of control systems in the 1980s and 1990s. [0] https://webhome.weizmann.ac.il/home/fhlevins/RTF/RTF-TOC.html https://webhome.weizmann.ac.il/home/fhlevins/RTF/RTF-TOC.htm...
- ranit 8y agoSo, which language or tool would you recommend?
- vardump 8y agoRust looks quite promising. Currently limited microcontroller architecture support is one of the biggest issues with it. Rust based RTOS would also be helpful for medium size devices. Of course small devices are fine on bare metal.
- v_lisivka 8y agoThere are some projects, for example [1],[2], but they require nightly compiler, i.e. they cannot be used in production yet. [1]: https://github.com/tock/tock/blob/master/doc/Getting_Started.md https://github.com/tock/tock/blob/master/doc/Getting_Started... [2]: https://github.com/hashmismatch/freertos.rs https://github.com/hashmismatch/freertos.rs
- iainmerrick 8y agoIf you don't use Rust yet, what do you use right now? I would have guessed C or C++. Maybe they're not great for the purpose but they're also just about the only game in town, no?
- vardump 8y agoMostly C. While C++ is easier to write, for very low level code, it is harder to maintain when you need to understand all of the side effects to maintain code safety. C++ compiler support is also sometimes not available. (And of course it's very like there'll be no Rust compiler available either in this case.)
- v_lisivka 8y agoRust looks promising, but it is not ready yet. I use it on iMX6, which is relatively powerful system, but on NRF52 we still use C. Maybe I will use it on NRF52 when support for bare hardware metal will be in stable (working group[1] is working on that). [1]: https://github.com/rust-lang-nursery/embedded-wg https://github.com/rust-lang-nursery/embedded-wg
- taneq 8y agoI've done a fair bit of embedded stuff with C++ and I completely agree. I've been watching Rust quite closely in the hopes that it's suitable for embedded development by the time my next round of projects comes up.