Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why Are C Compilers so Stupid?

compilers stupid
0
Posted

Why Are C Compilers so Stupid?

0

Most developers have migrated from assembly language to C. This is a great thing. However, there’s no way to scientifically write an interrupt handler in C. ISRs are very time sensitive, yet you have no idea how long a line of C will take. And so, we write our C functions in a fuzz of ignorance, having no concept of execution times until we actually run the code. If it’s too slow, well, just change something and try again! I’m not recommending not coding ISRs in C. Rather, this is more a rant against he current state of compiler technology. Years ago assemblers often produced t-state counts on the listing files, so you could easily figure how long a routine ran. Why don’t compilers do the same for us? Though there are lots of variables (a string compare will take a varying amount of time depending on the data supplied to it), certainly many C operations will give deterministic results. It’s time to create a feedback loop that tells us the cost, in time and bytes, for each line of code

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123