Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast?
by mrob on Monday January 28, 2019 @09:00AM
(#19017431)
C gives you better options for static analysis of worst case stack usage, e.g. https://github.com/PeterMcKinnis/WorstCaseStack
Proprietary software for this is also available with superior UI and features, and I expect people serious about high-reliability embedded systems already use it.
Rust Nightly does have limited support for printing stack usage by function with -Z emit-stack-sizes, but I could not find anything for analysis of worst case stack usage in whole programs.
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast?
by gpm on Monday January 28, 2019 @09:51AM
(#19017787)
Presumably you lose static analysis benefits as soon as you are mixing languages though?
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast?
by michaelt on Monday January 28, 2019 @09:32AM
(#19017633)
The 'embedded' market runs the gamut from $0.05 to $15+ and within that range, users have different concerns.
At the $15 end of the market, developers have a good chance of wanting to import code from other sources. For example, depending on the application, they might need an RTOS to provide multi-threading, FAT32 for an SD card, or a network stack with SSL implementation.
Often, the developer will want a 'lightweight' library, i.e. one intended for microcontrollers, and often this will be written in C.
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast?
by anmorgan on Monday January 28, 2019 @07:51AM
(#19017043)
Mainly because of the extensive Hardware Abstraction Layers (HAL) libraries available from most mcu vendors
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast?
by nraynaud on Monday January 28, 2019 @08:29AM
(#19017251)
1) they are crap and everybody hate them
2) I don’t see the point in buying an MCU whose timer is incredibly advanced (look at TIM1 and TIM8 on an STM32) and abstracting it afterwards.
You can translate C line by line into identical rust at no cost except that you have to write "unsafe" once per fn. With the exception of macros, but rust's replacements there are just better.
Keeping everything in one language seems like a worthwhile reason not to use C to me.