Better HN
topnewbestaskshowjobs
Log inSign up

jacketjorge

1 karma · joined Dec 14, 2024 (1y ago) · 2 submissions

Submissions

comment 1y ago · link · parent

Cortex M micros have a builtin preemptive async scheduler - the NVIC.

My personal style for doing embedded firmware have evolved to do everything in interrupt handlers and dynamically set priorities and pending bits to launch the next 'task' - main is just an empty for loop with a WFE/WFI instruction in it. The hardware is even specifically designed for this style with interrupt call chaining - when you exit an interrupt handler and another pending interrupt is asserted you dont take the full overhead of pushing/popping registers.

comment 1y ago · link · parent

I will never understand how people can say that dynamic typing makes them more productive:

"Have you ever changed the type of a function argument and then had to find all usages and change them? Have you ever changed a class and then had to recompile, and redeploy, all the classes that used that class? These are just three of the issues that don't occur nearly as often in dynamically typed languages."

If you change the type of an argument you OF COURSE want/need to change all usages of that function in both static and dynamic languages - how in the world did you expect sqrt(struct Person) to behave? - but static typing helps you quickly find all those instances so you're more productive in making that refactor.