Last updated

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 designed for (e.g., different CPU, operating system, or third party library). The term is also used when software/hardware is changed to make them usable in different environments. [1] [2]


Software is portable when the cost of porting it to a new platform is significantly less than the cost of writing it from scratch. The lower the cost of porting software, relative to its implementation cost, the more portable it is said to be.


The term "port" is derived from the Latin portāre , meaning "to carry". [3] When code is not compatible with a particular operating system or architecture, the code must be "carried" to the new system.

The term is not generally applied to the process of adapting software to run with less memory on the same CPU and operating system, nor is it applied to the rewriting of source code in a different language (i.e. language conversion or translation).

Software developers often claim that the software they write is portable , meaning that little effort is needed to adapt it to a new environment. The amount of effort actually needed depends on several factors, including the extent to which the original environment (the source platform) differs from the new environment (the target platform), the experience of the original authors in knowing which programming language constructs and third party library calls are unlikely to be portable, and the amount of effort invested by the original authors in only using portable constructs (platform specific constructs often provide a cheaper solution).


The number of significantly different CPUs and operating systems used on the desktop today is much smaller than in the past. The dominance of the x86 architecture means that most desktop software is never ported to a different CPU. In that same market, the choice of operating systems has effectively been reduced to three: Microsoft Windows, macOS, and Linux. However, in the embedded systems and mobile markets, portability remains a significant issue, with the ARM being a widely used alternative.

International standards, such as those promulgated by the ISO, greatly facilitate porting by specifying details of the computing environment in a way that helps reduce differences between different standards-conforming platforms. Writing software that stays within the bounds specified by these standards represents a practical although nontrivial effort. Porting such a program between two standards-compliant platforms (such as POSIX.1) can be just a matter of loading the source code and recompiling it on the new platform. However, practitioners often find that various minor corrections are required, due to subtle platform differences. Most standards suffer from "gray areas" where differences in interpretation of standards lead to small variations from platform to platform.

There also exists an ever-increasing number of tools to facilitate porting, such as the GNU Compiler Collection, which provides consistent programming languages on different platforms, and Autotools, which automates the detection of minor variations in the environment and adapts the software accordingly before compilation.

The compilers for some high-level programming languages (e.g. Eiffel, Esterel) gain portability by outputting source code in another high level intermediate language (such as  C) for which compilers for many platforms are generally available.

Two activities related to (but distinct from) porting are emulating and cross-compiling.

Porting compilers

Instead of translating directly into machine code, modern compilers translate to a machine independent intermediate code in order to enhance portability of the compiler and minimize design efforts. The intermediate language defines a virtual machine that can execute all programs written in the intermediate language (a machine is defined by its language and vice versa). [4] The intermediate code instructions are translated into equivalent machine code sequences by a code generator to create executable code. It is also possible to skip the generation of machine code by actually implementing an interpreter or JIT for the virtual machine. [5]

The use of intermediate code enhances portability of the compiler, because only the machine dependent code (the interpreter or the code generator) of the compiler itself needs to be ported to the target machine. The remainder of the compiler can be imported as intermediate code and then further processed by the ported code generator or interpreter, thus producing the compiler software or directly executing the intermediate code on the interpreter. The machine independent part can be developed and tested on another machine (the host machine). This greatly reduces design efforts, because the machine independent part needs to be developed only once to create portable intermediate code. [6]

An interpreter is less complex and therefore easier to port than a code generator, because it is not able to do code optimizations due to its limited view of the program code (it only sees one instruction at a time, and you need a sequence to do optimization). Some interpreters are extremely easy to port, because they only make minimal assumptions about the instruction set of the underlying hardware. As a result, the virtual machine is even simpler than the target CPU. [7]

Writing the compiler sources entirely in the programming language the compiler is supposed to translate, makes the following approach, better known as compiler bootstrapping , feasible on the target machine:

  1. Port the interpreter. This needs to be coded in assembly code, using an already present assembler on the target.
  2. Adapt the source of the code generator to the new machine.
  3. Execute the adapted source using the interpreter with the code generator source as input. This will generate the machine code for the code generator.

The difficult part of coding the optimization routines is done using the high-level language instead of the assembly language of the target.

According to the designers of the BCPL language, interpreted code (in the BCPL case) is more compact than machine code; typically by a factor of two to one. Interpreted code however runs about ten times slower than compiled code on the same machine. [8]

The designers of the Java programming language try to take advantage of the compactness of interpreted code, because a Java program may need to be transmitted over the Internet before execution can start on the target's Java Virtual Machine.

Porting of video games

Porting is also the term used when a video game designed to run on one platform, be it an arcade, video game console, or personal computer, is converted to run on a different platform. From the beginning of video games through to the 1990s, "ports", at the time often known as "conversions", were often not true ports, but rather reworked versions of the games. However, many 21st century video games are developed using software (often in C++) that can output code for one or more consoles as well as for a PC without the need for actual porting (instead relying on the common porting of individual component libraries).

Porting arcade games to home systems with inferior hardware was difficult. The ported version of Pac-man for the Atari 2600 omitted many of the visual features of the original game to compensate for the lack of ROM space and the hardware struggled when multiple ghosts appeared on the screen creating a flickering effect. The poor performance of the ported Pac-Man is cited by some scholars as a cause of the video game crash of 1983. [9]

Many early ports suffered significant gameplay quality issues because computers greatly differed. [10] Richard Garriott stated in 1984 at Origins Game Fair that Origin Systems developed computer games for the Apple II series first then ported them to Commodore 64 and Atari 8-bit, because the latter machines' sprites and other sophisticated features made porting from them to Apple "far more difficult, perhaps even impossible". [11] Reviews complained of ports that suffered from "Apple conversionitis", [12] retaining the Apple's "lousy sound and black-white-green-purple graphics"; [13] [14] after Garriott's statement, when Dan Bunten asked "Atari and Commodore people in the audience, are you happy with the Apple rewrites?" the audience shouted "No!" Garriott responded, "[otherwise] the Apple version will never get done. From a publisher's point of view that's not money wise". [11]

Others worked differently. Ozark Softscape, for example, wrote M.U.L.E. for the Atari first because it preferred to develop for the most advanced computers, removing or altering features as necessary during porting. Such a policy was not always feasible; Bunten stated that "M.U.L.E. can't be done for an Apple", [10] and that the non-Atari versions of The Seven Cities of Gold were inferior. [15] Compute!'s Gazette wrote in 1986 that when porting from Atari to Commodore the original was usually superior. The latter's games' quality improved when developers began creating new software for it in late 1983, the magazine stated. [16]

When a game is referred to as being "arcade perfect", this means that the game has been ported from an arcade version to another platform, such as a console or computer, without any significant alterations to the game's workings. This means that graphics, sound and gameplay, along with the game's other characteristics (including bugs), are faithful to the arcade version. It is a term mostly used by professional critics and sometimes, but not always, means the game is 100% identical. It usually means that differences may have been minor (such as longer loading times), or simply that the port may have been the one that preserved the experience of the original game the most.

"(Console) port" is a game that was originally made for a console (such as Wii or Xbox 360) before an identical version is created which can be played on a personal computer or any other console. This term has been widely used by the gaming community. The process of porting a game from a console to a PC is often regarded negatively due to the higher levels of performance that computers generally have being underutilized, partially due to console hardware being fixed throughout their run (with games being developed for console specs), while PCs become more powerful as hardware evolves, but also due to ported games sometimes being poorly optimized for PCs, or lazily ported. Whilst broadly similar, architectural differences may exist such as the use of unified memory on a console.

See also


  1. Whitten, D.E.; Demaine, P.A.D. (March 1975). "A machine and configuration independent Fortran: Portable Fortran". IEEE Transactions on Software Engineering. SE-1 (1): 111–124. doi:10.1109/TSE.1975.6312825.
  2. "Portability Issues". .. discusses .. portability of .. Fortran
  3. "port, v.2" . Oxford English Dictionary (OED Online). Oxford University Press. Retrieved December 21, 2017. Origin: Of multiple origins. Partly a borrowing from French. Partly a borrowing from Latin. Etymons: French porter; Latin portāre. ... 1. trans. To carry, bear, or convey; to bring.
  4. Tanenbaum 1984 , p. 3. §1.1 Languages,Levels, and Virtual Machines describes the terms and their relations.
  5. Tanenbaum 1984 , p. 2. Ch. 1 Introduction explains translation and interpretation.
  6. Richards & Whitby-Strevens 1984 , p. 124. §7.1 Introduction explains compiler portability using intermediate code.
  7. Richards & Whitby-Strevens 1984 , p. 133. §7.4 The bootstrapping process and INTCODE explains the role of the INTCODE interpreter.
  8. Richards & Whitby-Strevens 1984 , p. 136. §7.4.3 Example gives an example translation of a BCPL program into INTCODE for the interpreter.
  9. Nicoll, Benjamin (2015). "Bridging the Gap: The Neo Geo, the Media Imaginary, and the Domestication of Arcade Games". Games and Culture. doi:10.1177/1555412015590048.
  10. 1 2 Bunten, Dan (December 1984). "Dispatches / Insights From the Strategy Game Design Front". Computer Gaming World. p. 40. Retrieved 31 October 2013.
  11. 1 2 "The CGW Computer Game Conference". Computer Gaming World (panel discussion). October 1984. p. 30. Retrieved 31 October 2013.
  12. Dunnington, Benn; Brown, Mark R.; Malcolm, Tom (January–February 1987). "64/128 Gallery". Info. pp. 14–21.CS1 maint: date format (link)
  13. Stanton, Jeffrey; Wells, Robert P.; Rochowansky, Sandra; Mellid, Michael, eds. (1984). The Addison-Wesley Book of Atari Software. Addison-Wesley. pp. 12, 21, 44, 126. ISBN   0-201-16454-X.
  14. Bernstein, Harvey (May 1985). "Beyond Castle Wolfenstein". Antic. p. 83. Retrieved 8 January 2015.
  15. Bunten, Dan. "The Game Collection". Ozark Softscape M.U.L.E. Retrieved 2017-10-04.
  16. Yakal, Kathy (June 1986). "The Evolution of Commodore Graphics". Compute!'s Gazette. pp. 34–42. Retrieved 2019-06-18.

Related Research Articles

Atari ST Line of home computers from Atari Corporation

The Atari ST is a line of home computers from Atari Corporation and the successor to the Atari 8-bit family. The initial ST model, the 520ST, saw limited release in April–June 1985 and was widely available in July. The Atari ST is the first personal computer to come with a bitmapped color GUI, using a version of Digital Research's GEM released in February 1985. The 1040ST, released in 1986, is the first personal computer to ship with a megabyte of RAM in the base configuration and also the first with a cost-per-kilobyte of less than US$1.

BCPL is a procedural, imperative, and structured computer programming language. Originally intended for writing compilers for other languages, BCPL is no longer in common use. However, its influence is still felt because a stripped down and syntactically changed version of BCPL, called B, was the language on which the C programming language was based. BCPL introduced several features of many modern programming languages, including using curly braces to delimit code blocks. BCPL was first implemented by Martin Richards of the University of Cambridge in 1967.

A compiler is a computer program that translates computer code written in one programming language into another language. The name compiler is primarily used for programs that translate source code from a high-level programming language to a lower level language to create an executable program.

Commodore 64 8-bit home computer introduced in 1982

The Commodore 64, also known as the C64 or the CBM 64, is an 8-bit home computer introduced in January 1982 by Commodore International. It has been listed in the Guinness World Records as the highest-selling single computer model of all time, with independent estimates placing the number sold between 10 and 17 million units. Volume production started in early 1982, marketing in August for US$595. Preceded by the Commodore VIC-20 and Commodore PET, the C64 took its name from its 64 kilobytes(65,536 bytes) of RAM. With support for multicolor sprites and a custom chip for waveform generation, the C64 could create superior visuals and audio compared to systems without such custom hardware.

UCSD Pascal Pascal programming language system

UCSD Pascal is a Pascal programming language system that runs on the UCSD p-System, a portable, highly machine-independent operating system. UCSD Pascal was first released in 1977. It was developed at the University of California, San Diego (UCSD).

SCUMM scripting language developed at LucasArts

Script Creation Utility for Maniac Mansion (SCUMM) is a video game engine developed at Lucasfilm Games, later renamed LucasArts, to ease development on their first graphic adventure game Maniac Mansion (1987). It was subsequently used as the engine for later LucasArts adventure games.

In computing, cross-platform software is computer software that is implemented on multiple computing platforms. Cross-platform software may be divided into two types; one requires individual building or compilation for each platform that it supports, and the other one can be directly run on any platform without special preparation, e.g., software written in an interpreted language or pre-compiled portable bytecode for which the interpreters or run-time packages are common or standard components of all platforms.

MAME emulation software that aims to recreate the hardware of many arcade game systems

MAME is a free and open-source emulator designed to recreate the hardware of arcade game systems in software on modern personal computers and other platforms. The intention is to preserve gaming history by preventing vintage games from being lost or forgotten. The aim of MAME is to be a reference to the inner workings of the emulated arcade machines; the ability to actually play the games is considered "a nice side effect". Joystiq has listed MAME as an application that every Windows and Mac gamer should have.

<i>Marble Madness</i> arcade video game

Marble Madness is an arcade video game designed by Mark Cerny and published by Atari Games in 1984. It is a platform game in which the player must guide a marble through six courses, populated with obstacles and enemies, within a time limit. The player controls the marble by using a trackball. Marble Madness is known for using innovative game technologies: it was Atari's first to use the Atari System 1 hardware, the first to be programmed in the C programming language, and one of the first to use true stereo sound.

Multi Emulator Super System (MESS) is an emulator for various consoles and computer systems, based on the MAME core and now a part of MAME. MESS emulates portable and console gaming systems, computer platforms, and calculators. The project strives for accuracy and portability and therefore is not always the fastest emulator for any one particular system. Its accuracy makes it also useful for homebrew game development.

Action! (programming language) programming language

Action! is a procedural programming language similar to ALGOL that is intended to produce high-performance programs for the Atari 8-bit family. The language was written by Clinton Parker and distributed on ROM cartridge by Optimized Systems Software (OSS) starting in 1983. It was one of the first of OSS's bank switching "Super Cartridges", with a total of 16 kB of code.

1982 was the peak year of arcade and console games during the Golden age of arcade video games. Troubles at Atari, Inc. late in the year triggered the North American video game crash of 1983. Many games were released that would spawn franchises, or at least sequels, including Dig Dug, Pole Position, Mr. Do!, Pitfall!, Q*bert, and Xevious. Additional consoles add to a crowded market. The new Commodore 64 goes on to eventually dominate the 8-bit home computer market.

Fueled by the previous year's release of the colorful and appealing Pac-Man, the audience for arcade games in 1981 became much wider. Pac-Man influenced maze games began appearing in arcades and on home systems. Nintendo broke from their mediocre early releases with Donkey Kong which defined the platform genre.

A PC game, also known as a computer game or personal computer game, is a type of video game played on a personal computer rather than a video game console or arcade machine. Its defining characteristics include: more diverse and user-determined gaming hardware and software; and generally greater capacity in input, processing, video and audio output. The uncoordinated nature of the PC game market, and now its lack of physical media, make precisely assessing its size difficult.

In the history of video games, the second-generation era refers to computer and video games, video game consoles, and handheld video game consoles available from 1976 to 1992. Notable platforms of the second generation include the Fairchild Channel F, Atari 2600, Intellivision, Odyssey², and ColecoVision. The generation began in November 1976 with the release of the Fairchild Channel F. This was followed by the Atari 2600 in 1977, Magnavox Odyssey² in 1978, Intellivision in 1980 and then the Emerson Arcadia 2001, ColecoVision, Atari 5200, and Vectrex, all in 1982. By the end of the era, there were over 15 different consoles. It coincided with, and was partly fueled by, the golden age of arcade video games. This peak era of popularity and innovation for the medium resulted in many games for second generation home consoles being ports of arcade games. Space Invaders, the first arcade game to be ported, was released in 1980 for the Atari 2600. Coleco packaged Nintendo's Donkey Kong with the ColecoVision when it was released on August 1982.

Emulator system that emulates a real system such that the behavior closely resembles the behavior of the real system

In computing, an emulator is hardware or software that enables one computer system to behave like another computer system. An emulator typically enables the host system to run software or use peripheral devices designed for the guest system. Emulation refers to the ability of a computer program in an electronic device to emulate another program or device. Many printers, for example, are designed to emulate Hewlett-Packard LaserJet printers because so much software is written for HP printers. If a non-HP printer emulates an HP printer, any software written for a real HP printer will also run in the non-HP printer emulation and produce equivalent printing. Since at least the 1990s, many video game enthusiasts have used emulators to play classic arcade games from the 1980s using the games' original 1980s machine code and data, which is interpreted by a current-era system.