![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
What is portability?A program may be considered portable if it can be 'moved', migrated, to different computing environments.These environments do not just include different operating systems, running on different forms of hardware, but can include different (human) interfaces and natural languages. Many (most?) operating systems are written in C and are, in theory, portable. This is possible because C toolchains (the pre-processor, compiler, and linker) are supported by header files and libraries that have 'extended' the language, without requiring the language, itself, to be changed. (the above paragraph is not strictly correct, as C11 has recently added new features aiding portability, such as in-language support for Unicode).
C is portable at the level of its source-codeC programs require compiling in their new computing environment, or cross-compiled on an existing environment with knowledge of the destination hardware architecture and able to provide the necessary libraries. Examples include being able to develop programs on an Intel-based Linux platform, destined for an ARM-based Raspberry Pi platform (also running Linux), or developing a program under Apple's macOS destined for an iPhone (and then both uploaded (by network or cable) to the new environment).C's source-level portability is in contrast to:
CITS2002 Systems Programming, Lecture 22, p2, 16th October 2023.
|