Pointers

https://twitter.com/theprimeagen/status/1683671315377541121

>i have become unsafe, destroyer of production

30
Jump in the discussion.

No email address required.

C is still useful in some embedded contexts where you don't want to bring along an entire C++ runtime but yeah that's about it.

Jump in the discussion.

No email address required.

This feels less and less common, no?


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

It is. People tend to focus on cost improvements with high-end hardware but the same is true of low-end stuff, actually the effect is probably felt even more there. Realistically there's just little reason to have extremely weak microprocessors anymore. You can get something that can run C++ just fine for very very cheap and with low power draw. There are obviously still some specialty applications where you run on a tiny microcontroller with 128 KB RAM (for example) but that's become less and less common.

I just checked and you can buy a Raspberry Pi Zero 2 W for $15. That's a full butt computer that runs Linux with 512 MB RAM, a wifi chip, various connectors (including mini HDMI and video output) for $15. Obviously a major engineering firm would be designing their own boards and stuff and not using this but that's just an example for how cheap low-end microprocessors are these days.

tbh at this point I think most of the embedded systems that are only running C and not at least C++ are doing so for legacy reasons.

Jump in the discussion.

No email address required.

I'm seeing rumblings of Rust being popular for embedded too but clearly that'll take another five years to be really established.

But yeah, I remember the cool HN post of a guy finding a cheap enough chip to run Linux on for his business cards.

https://www.thirtythreeforty.net/posts/2019/12/my-business-card-runs-linux/

Appears to be 2019 even.


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

I actually really like Rust and hope it takes off in this space. The community is :marseytrain: garbage but the actual language and ecosystem are good.

I haven't worked in embedded development for many years, but even when I did, the newer hardware we were rolling out was like 20x more powerful than what came before, and cheaper. It was actually kinda annoying because they figured with the substantially more powerful microprocessor, they didn't need any dedicated chips to run the serial buses. Works fine in practice but it means if you have to debug anything on the board, every time you hit a breakpoint (even a conditional breakpoint that misses) it fricks all the serial connections up. Made debugging a bit of a pain.

Jump in the discussion.

No email address required.

Any opinion on the Zephyr RTOS?

Kind of funny that it’s C when we were talking that becoming less and less popular but it seems to have a really good build system.


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

Sorry no, it's been many years since I've worked with an RTOS. I had to look up a list of them to find the one my old job used, it was ThreadX. It seemed fine, at least while I was there I didn't uncover any bugs in the RTOS so that's about as good as it gets. All the boards it ran on were custom/proprietary as well so I doubt any of the free ones would work right out the box.

Jump in the discussion.

No email address required.

Makes sense. It definitely seems like a “good rtos” would be silly with modern chips if you can just run friendly Linux :marseyshrug:


Follower of Christ :marseyandjesus: Tech lover, IT Admin, heckin pupper lover and occasionally troll. I hold back feelings or opinions, right or wrong because I dislike conflict.

Jump in the discussion.

No email address required.

Yeah, it really is - I work in embedded and the hardware I'm working with is powerful enough that we can easily use modern C++ and not care. The efficiency gains (whether in execution speed or memory usage) are so small they're not worth the trade-off in developer time.

Jump in the discussion.

No email address required.

And building robots that run on microcontrollers is really fun so everyone should learn c


Putting the :e: in :marseyexcited:

Jump in the discussion.

No email address required.

This

Jump in the discussion.

No email address required.

When I don’t use C I use Go or, if really lazy, Python

Jump in the discussion.

No email address required.

Python is just so cozy

:marseytoasty:

I use it for the vast majority of my personal projects since the data sets I'm working with aren't large enough to need better performance and they aren't complicated enough to require static typing.

Jump in the discussion.

No email address required.

C is so 1970s. The future is JavaScript, bros.

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.