Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For the microcontrollers example, the 'C' that the device's compiler uses could be a very loose implementation of a subset of the language. How do you ensure that the code you're compiling to will work for it?


Depends on the microcontroler.

The majority of them also enjoy Pascal and Basic compilers.

https://www.mikroe.com/

So sometimes, there is indeed an option.

Also many languages have compilers that are able to generate C code.

As to ensuring, well that is what testing is for.


That's a good point. I doubt most languages generating C put a lot of thought into what subset is supported in proprietary compilers. If anyone tries one, then there could be profiles done for unusual compilers where the generated code has certain properties. Far as the past, I think people couldve tested the output just to see what happened. Then, either ditch high-level language per fuction, module, or project depending on how far incompatibility effects went.

How does that sound?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: