
A
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
is said to be portable if there is very low effort required to make it run on different
platforms. The pre-requirement for portability is the generalized
abstraction
Abstraction in its main sense is a conceptual process wherein general rules and concepts are derived from the usage and classification of specific examples, literal ("real" or " concrete") signifiers, first principles, or other methods.
"An a ...
between the application logic and
system interfaces. When software with the same functionality is produced for several
computing platform
A computing platform or digital platform is an environment in which a piece of software is executed. It may be the hardware or the operating system (OS), even a web browser and associated application programming interfaces, or other underlying ...
s, portability is the key issue for development cost reduction.
Strategies for portability
Software portability may involve:
* Transferring installed program files to another computer of basically the same architecture.
* Reinstalling a program from distribution files on another computer of basically the same architecture.
*
Building
A building, or edifice, is an enclosed structure with a roof and walls standing more or less permanently in one place, such as a house or factory (although there's also portable buildings). Buildings come in a variety of sizes, shapes, and funct ...
executable
In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions", as opposed to a data fil ...
programs for different platforms from
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
; this is what is usually understood by "
porting
In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally des ...
".
Similar systems
When
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s of the same family are installed on two computers with
processors
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, an ...
with similar
instruction set
In computer science, an instruction set architecture (ISA), also called computer architecture, is an abstract model of a computer. A device that executes instructions described by that ISA, such as a central processing unit (CPU), is called a ...
s it is often possible to transfer the files implementing program files between them.
In the simplest case, the file or files may simply be copied from one machine to the other. However, in many cases, the software is
installed on a computer in a way which depends upon its detailed hardware, software, and setup, with
device driver
In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and o ...
s for particular devices, using installed operating system and supporting software components, and using different
drives or
directories
Directory may refer to:
* Directory (computing), or folder, a file system structure in which to store computer files
* Directory (OpenVMS command)
* Directory service, a software application for organizing information about a computer network's ...
.
In some cases, software, usually described as "
portable software", is specifically designed to run on different computers with compatible operating systems and processors, without any machine-dependent installation. Porting is no more than transferring specified directories and their contents. Software installed on portable
mass storage
In computing, mass storage refers to the storage of large amounts of data in a persisting and machine-readable fashion. In general, the term is used as large in relation to contemporaneous hard disk drives, but it has been used large in relati ...
devices such as
USB sticks can be used on any compatible computer on simply plugging the storage device in, and stores all configuration information on the removable device. Hardware- and software-specific information is often stored in
configuration file
In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system ...
s in specified locations (e.g. the
registry on machines running
Microsoft Windows).
Software which is not portable in this sense will have to be transferred with modifications to support the environment on the destination machine.
Different processors
the majority of desktop and laptop computers used
microprocessor
A microprocessor is a computer processor where the data processing logic and control is included on a single integrated circuit, or a small number of integrated circuits. The microprocessor contains the arithmetic, logic, and control circu ...
s compatible with the 32- and 64-bit
x86 instruction sets. Smaller portable devices use processors with different and incompatible instruction sets, such as
ARM. The difference between larger and smaller devices is such that detailed software operation is different; an application designed to display suitably on a large screen cannot simply be ported to a pocket-sized smartphone with a tiny screen even if the functionality is similar.
Web applications
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
are required to be processor independent, so portability can be achieved by using web programming techniques, writing in
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
. Such a program can run in a common web browser. Such
web application
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
s must, for security reasons, have limited control over the host computer, especially regarding reading and writing files. Non-web programs, installed upon a computer in the normal manner, can have more control, and yet achieve system portability by linking to portable libraries providing the same interface on different systems.
Source code portability
Software can be compiled and
linked from source code for different operating systems and processors if written in a programming language supporting compilation for the platforms. This is usually a task for the program developers; typical users have neither access to the source code nor the required skills.
In
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
environments such as Linux the source code is available to all. In earlier days source code was often distributed in a standardised format, and could be built into executable code with a standard
Make tool for any particular system by moderately knowledgeable users if no errors occurred during the build. Some
Linux distribution
A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading on ...
s distribute software to users in source form. In these cases there is usually no need for detailed adaptation of the software for the system; it is distributed in a way which
modifies the compilation process to match the system.
Effort to port source code
Even with seemingly portable languages like
C and
C++, the effort to port source code can vary considerably. The authors of
UNIX/32V
UNIX/32V is an early version of the Unix operating system from Bell Laboratories, released in June 1979. 32V was a direct port of the Seventh Edition Unix to the DEC VAX architecture.
Overview
Before 32V, Unix had primarily run on DEC P ...
(1979) reported that "
e
(Bourne) shell ..required by far the largest conversion effort of any supposedly portable program, for the simple reason that it is not portable."
[Thomas B. London and John F. Reiser (1978)]
A Unix operating system for the DEC VAX-11/780 computer
Bell Labs internal memo 78-1353-4.
Sometimes the effort consists of recompiling the source code, but sometimes it is necessary to rewrite major parts of the software. Many language specifications describe implementation defined behaviour (e.g. right shifting a signed integer in C can do a
logical
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premises ...
or an
arithmetic
Arithmetic () is an elementary part of mathematics that consists of the study of the properties of the traditional operations on numbers—addition, subtraction, multiplication, division, exponentiation, and extraction of roots. In the 19th c ...
shift). Operating system functions or third party libraries might not be available on the target system. Some functions can be available on a target system, but exhibit slightly different behaviour (E.g.: utime() fails under Windows with EACCES, when it is called for a directory). The program code itself can also contain unportable things, like the paths of include files. Drive letters and the backslash as path delimiter are not accepted on all operating systems. Implementation defined things like
byte order and the size of an
int can also raise the porting effort. In practice the claim of languages, like
C and
C++, to have the WOCA (
write once, compile anywhere) is arguable.
See also
*
C (programming language)
*
Cross-platform software
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
*
Data portability Data portability is a concept to protect users from having their data stored in "silos" or "walled gardens" that are incompatible with one another, i.e. closed platforms, thus subjecting them to vendor lock-in and making the creation of data backup ...
*
Hardware-dependent software
Hardware-dependent software (HDS or HdS), the part of an operating system that varies across microprocessor boards and is comprised notably of device drivers and of boot code which performs hardware initialization. HDS does not comprise code which ...
*
Interoperability
Interoperability is a characteristic of a product or system to work with other products or systems. While the term was initially defined for information technology or systems engineering services to allow for information exchange, a broader def ...
*
Language interoperability Language interoperability is the capability of two different programming languages to natively interact as part of the same system and operate on the same kind of data structures.
There are many ways programming languages are interoperable with on ...
*
Portability testing
*
Porting
In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally des ...
*
Source-to-source compiler
A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a programming language as its input and produces an equivalent sou ...
References
Sources
*
*
*
{{DEFAULTSORT:Software Portability
Software quality