3 ms·
Go on, name a few.
by omeid2 3y ago
Go on, name a few.
- throwawayEmb 3y agoThe STM8 processor for instance has no C++ or Rust compiler to my knowledge, even though it was produced in huge volumes [1]. It is still quite common to see proprietary compiler-suites in the embedded world. Most only support C. Some do not even support C99 :) Sure for many ARM targets (e.g. Cortex series), you can use GCC or LLVM etc. and get access to C++. Many embedded shops targetting the lower end (8-32 bit CPUs <100MHz + 8-32kb RAM) prefer C for the simplicity. 1: STMicro announced back in 2016 that they’d sold more than 2 billion of these chips, so it’s not some obscure little niche processor.
- omeid2 3y agoYou can't run libwebsockets on STM8. You can _only_ use it anywhere you can use Linux, BSD, or FreeRTOS, which also means you can use C++ and Rust.
- throwawayEmb 3y agoAnything POSIX should do, no? Anyway, I still think the point stands: many lower level targets do not have C++ or Rust compilers, but do have okay-ish C compilers. You replied to > I can think of several embedded platforms where Rust or C++ is not even an option. … asking “Go on, name a few”. I understood this as “name a few targets for which C++ and/or Rust is unavailable”. These targets do exist and are perhaps more common than you assume. In my own experience, it is mostly seen with small micros though. But perhaps I misunderstood you?
- glonq 3y agoyour point does stand. ignore the trolls.
- omeid2 3y agoContext is everything. Bringing up STM8 in the context of libwebsockets is as relevant as bringing up PLCs, not at all. Of course there will always platforms where C remains the only option because honestly, C is just quasi-portable glorified asm; but the point is that if you have the luxury of a platform that can run Libwebsockets, you're most likely in a position to use C++ or Rust, or some other safe language. That is the point.
- throwawayEmb 3y agoI was replying to this > Genuine question. With Rust and C++, even for embedded systems, what is the use case for starting a new project that does binary encoding and network with such an unsafe language like C? And I gave a genuine answer :) If you want to restrict the context to libwebsockets, I suggest you edit your question to clarify that. Network code != libwebsockets. I have written Ethernet-connected firmware without OS/RTOS on 8-32 bit MCUs that definitely would not be able to run libwebsocket. There is a big world in embedded between PLCs and e.g. RasPi. That is often where you use C (in my experience).
- sigsev_251 3y agoWhat's even funnier is that for STM8 one can choose between four compilers, all offering first class citizen support for the platform. Also, it's pretty convenient that two of them, namely IAR and SDCC, support the current language standards.
- israrkhan 3y agoThere are several DSP & VLIW platforms that have their own toolchain (not gcc), and they only support C programming language (for example Trimedia VLIW processors, TM1300, PNX1500, PNX1700 and a lot more SoC based on TM32/TM64 cores). In addition there are tiny microcontrollers (8051/AT89, STM32 etc) Essentially these are Platforms with 1. Very specific instruction set (DSPs) 2. extremely limited resources 3. specialized toolchain and no LLVM support