27 ms·
Devil’s advocate: compared to assembly, C is portable, but compared to a lot of high-level languages, C isn’t very portable. Every “implementation defined” fea
by Someone 6y ago
Devil’s advocate: compared to assembly, C is portable, but compared to a lot of high-level languages, C isn’t very portable.
Every “implementation defined” feature (https://en.wikipedia.org/wiki/Unspecified_behavior#Implementation-defined_behavior https://en.wikipedia.org/wiki/Unspecified_behavior#Implement...) creates two different languages (examples are sizes of basic numeric types, signedness of the char type, and evaluation order of arguments)
Also, the standard library is so limited that, historically, you needed lots of stuff that wasn’t standardized between systems (https://en.wikipedia.org/wiki/GNU_Autotools https://en.wikipedia.org/wiki/GNU_Autotools: “It can be difficult to make a software program portable: the C compiler differs from system to system; certain library functions are missing on some systems; header files may have different names.”)
But yes, bringing up C on a system is a lot easier than doing the same for, to pick another extreme, Ada, but that’s because only half the job is done. Autotools does a bit of the rest, but still requires help from program writers.
- FartyMcFarter 6y ago> compared to a lot of high-level languages, C isn’t very portable. Right, with C, you may have to fix a few bugs to get a program working properly in a new system due to the reasons you mention. But with many other languages, you'd have to port a compiler and the standard library first, which is probably harder :)
- pjmlp 6y agoDepends on the language, luckily other languages are equality blessed in portability as other people have spent similar resources making their toolchains available elsewhere.