Comment by runjake
- Simple syntax and easy to read.
- Compiles down to efficient machine code.
- Very well documented.
- Preferably the language is close to the metal.
I avoid using C practically everywhere these days, but tend to prefer it for embedded programs for the above reasons,
> Preferably the language is close to the metal.
To expand on this a bit:
The language designers do not know what absurd hardware you are running on. They don't know that you're running an experimental DMA controller that works in a completely different way from their mental model of what DMA is like. They don't know that you're having to register interrupt handlers by directly jamming the addresses of functions into the CPU's vector table, nor do they know where your CPU stores that vector table.
So you have to be able to do all of that yourself, if needed. You have to be able to write to the vector table. You have to be able to write to the DMA controller's registers. You have to be able to write to arbitrary addresses in memory, too, because some hardware uses memory mapped I/O.
It's fine to require an "unsafe" keyword to do all that. But it has to be possible.