News for hackers. Stuff that matters.
Re:C and C++ Prioritize Performance over Correctness by Ar-Curunir on Friday August 18, 2023 @04:36PM (#37181756)
[delayed]
Re:C and C++ Prioritize Performance over Correctness by xedrac on Friday August 18, 2023 @05:03PM (#37182076)
In C++, you'll often see projects just use boost, which is a big monolith of useful libraries.
Re:C and C++ Prioritize Performance over Correctness by tumdum_ on Friday August 18, 2023 @05:19PM (#37182273)
Embedded microcontrollers are not the place where boost is used.
Re:C and C++ Prioritize Performance over Correctness by oasisaimlessly on Saturday August 19, 2023 @01:56AM (#37185954)
Counterpoint: I use Boost on embedded microcontrollers. (Albeit only header-only components of Boost.)
Re:C and C++ Prioritize Performance over Correctness by MarkMarine on Friday August 18, 2023 @05:43PM (#37182555)
I suppose that wasn’t clear. My mistake. I use C/C++ for micro controller code every day, because Rust doesn’t support my microcontroller, doesn’t have a real RTOS, and I’m making real hardware. Something that needs to run in the field for 10+ years and I can’t get out there and ensure it’s updated, and my company doesn’t want to invest millions of dollars on beta testing embedded rust on. So embedded is out for now but I’m looking forward to when it’s supported fully and out of beta. Most embedded controllers come with some RTOS and libraries they support, written in C.

For tooling, I can context switch out of C++ which does have boost, into [rust, go, python… etc] and deal with that switch, or just be lazy and write it in C++. I’ve tried to write three tools in Rust so far, and the pain of not having a good stdlib, of essentially searching the internet for a blog post that solves my issue then finding the blog post was written by one dev 4 years ago to pump up their library that was written 4 years ago and then never supported after that… it’s a bit exhausting.

Again, before ya’ll attack. This is from the perspective of a willing, excited customer. I want to use Rust at work and advocate for it. Just saying, it’s not easy in the state it’s in.

Re:C and C++ Prioritize Performance over Correctness by seabass-labrax on Friday August 18, 2023 @05:57PM (#37182710)
Which microcontroller are you using? Rust support for embedded targets is slowly improving, so there might be a beta build for your chip.
Re:C and C++ Prioritize Performance over Correctness by MarkMarine on Saturday August 19, 2023 @11:16AM (#37189606)
ESP-32, the Rust support is not mature enough to ship commercially.

C-410 from Qualcomm, which is a whole different world, I can’t even look at the source code.