Porting

In software development, porting is the process of adapting software to run in a different context. Often it involves modifying source code so that a program can run on a different platform (i.e. on a different CPU or operating system) or in a different environment (i.e. with a different library or framework). It also describes adapting a change or feature from one codebase to another – even between different versions of the same software.[1]

Software is classified as portable if it can be hosted in a different context with no change to the source code. It might be considered portable if the cost of adapting it to a context is significantly less than the cost of writing it from scratch. The lower the cost of porting relative to the cost to re-write, the more portable it is said to be. The effort depends on several factors including the extent to which the original context differs from the new context, the skill of the programmers, and the portability of the codebase.

## Contents

* 1 Etymology
* 2 History
* 3 Porting compilers
* 4 Porting of video games
* 5 See also
* 6 References

## Etymology

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

## History

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. In the embedded systems and mobile markets, however, 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, but 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.

## 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).[3] 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.[4]

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.[5]

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 users 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.[6]

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.[7]

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 (JVM).

##  Porting of video games

"Video game port" redirects here. For the hardware connector, see Game port.

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, perhaps with some minor differences.[8] 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 due to the limitations of different systems. For example, the 1982 game The Hobbit, a text adventure augmented with graphic images, has significantly different graphic styles across the range of personal computers that its ports were developed for.[9] Many 21st century video games, however, 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).[9]

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 Atari 2600 Pac-Man is cited by some scholars as a cause of the video game crash of 1983.[10]

Many early ports suffered significant gameplay quality issues because computers greatly differed.[11] Richard Garriott stated in 1984 at Origins Game Fair that Origin Systems developed video games for the Apple II first then ported them to Commodore 64 and Atari 8-bit computers, because the latter machines' sprites and other sophisticated features made porting from them to Apple "far more difficult, perhaps even impossible".[12] Reviews complained of ports that suffered from "Apple conversionitis",[13] retaining the Apple's "lousy sound and black-white-green-purple graphics";[14][15] 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".[12]

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",[11] and that the non-Atari versions of The Seven Cities of Gold were inferior.[16] 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.[17]

In porting arcade games, the terms "arcade perfect" or "arcade accurate" were often used to describe how closely the gameplay, graphics, and other assets on the ported version matched the arcade version. Many arcade ports in the early 1980s were far from arcade perfect as home consoles and computers lacked the sophisticated hardware in arcade games, but games could still approximate the gameplay. Notably, Space Invaders on the Atari VCS became the console's killer app despite its differences,[18] while the later Pac-Man port was notorious for its deviations from the arcade version.[19] Arcade-accurate games became more prevalent starting in the 1990s as home consoles caught up to the power of arcade systems. Notably, the Neo Geo system from SNK, which was introduced as a multi-game arcade system, would also be offered as a home console with the same specifications. This allowed arcade perfect games to be played at home.[9]

A "console port" is a game that was originally or primarily made for a console before a version is created which can be played on a personal computer. The process of porting games from console to PC is often regarded more cynically than other types of port. This perception stems from the fact that some PC ports do not fully utilize the more powerful hardware available on many PCs, even at the time of a console's launch. Because console hardware remains fixed throughout a generation while PC hardware continues to advance, games designed around console limitations may appear under-optimized when released on PC. While broadly similar today, some architectural differences persist, such as the use of unified memory and smaller OSs on consoles. Other objections arise from user interface differences conventional to consoles, such as gamepads, TFUIs accompanied by narrow FoV, fixed checkpoints, online restricted to official servers or P2P, poor or no modding support, as well as the generally greater reliance among console developers on internal hard coding and defaults instead of external APIs and configurability, all of which may require expensive deep reaching redesign to avoid a "lazy" feeling port to PC.[20]

Impossible ports are ports of video games onto hardware significantly weaker than the target release.[21] Examples include ports of PlayStation 4 and Xbox One games, such as Software:Nier: Automata and Software:The Witcher 3: Wild Hunt, to the Nintendo Switch.[22][23]

## See also

* Backporting
* Video game console emulator
* Cross compiler - Cross-platform machine-code compiler
* Cross-platform software - Computer software installed on multiple computing platforms
* Emulator
* Language binding - Software library that allows using another library coded in another programming language
* List of system quality attributes - Non-functional requirements for system evaluation
* Poshlib - Software framework used in cross-platform software development
* Program transformation - Automated generation of a computer program
* Software portability - Ability of a program to run on different platforms with little alteration
* Source port - Communications endpoint in an operating system
* Source-to-source compiler - Translator of computer source code
* Write once, compile anywhere - Design goal for source code to be universally compilable

## References

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. ↑ "port, v.2". Oxford University Press. http://www.oed.com/view/Entry/148098. "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."
3. ↑ Tanenbaum 1984, p. 3, § 1.1 Languages, Levels, and Virtual Machines describes the terms and their relations.
4. ↑ Tanenbaum 1984, p. 2\. Ch. 1 Introduction explains translation and interpretation.
5. ↑ Richards & Whitby-Strevens 1984, p. 124, § 7.1 Introduction explains compiler portability using intermediate code.
6. ↑ Richards & Whitby-Strevens 1984, p. 133, § 7.4 The bootstrapping process and INTCODE explains the role of the INTCODE interpreter.
7. ↑ Richards & Whitby-Strevens 1984, p. 136, § 7.4.3 Example gives an example translation of a BCPL program into INTCODE for the interpreter.
8. ↑ Wolf, Mark J. P. (2008). "Glossary". The Video Game Explosion: A History from PONG to Playstation and Beyond. Bloomsbury Publishing. p. 315. ISBN 978-0-313-33868-7. https://books.google.com/books?id=XiM0ntMybNwC&pg=PA315.
9. ↑ 9.0 9.1 9.2 Grabarczyk, Pawel; Aarseth, Espen (2019), Port or conversion? An ontological framework for classifying game versions | DiGRA Conference 2019
10. ↑ 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.
11. ↑ 11.0 11.1 Bunten, Dan (December 1984). "Dispatches / Insights From the Strategy Game Design Front". Computer Gaming World: 40. http://www.cgwmuseum.org/galleries/index.php?year=1984&pub=2&id=19. Retrieved 31 October 2013.
12. ↑ 12.0 12.1 "The CGW Computer Game Conference". Computer Gaming World: 30. October 1984. http://www.cgwmuseum.org/galleries/index.php?year=1984&pub=2&id=18. Retrieved 31 October 2013.
13. ↑ Dunnington, Benn; Brown, Mark R.; Malcolm, Tom (January–February 1987). "64/128 Gallery". Info: 14–21. https://archive.org/stream/info-magazine-13/Info_Issue_13_1987_Jan-Feb#page/n13/mode/2up.
14. ↑ The Addison-Wesley Book of Atari Software. Addison-Wesley. 1984. pp. 12,21,44,126. ISBN 0-201-16454-X. https://archive.org/stream/Atari_Software_1984#page/n21/mode/2up.
15. ↑ Bernstein, Harvey (May 1985). "Beyond Castle Wolfenstein". Antic: pp. 83. https://archive.org/stream/1985-05-anticmagazine/Antic_Vol_4-01_1985-05_New_Super_Ataris#page/n81/mode/2up.
16. ↑ Bunten, Dan. "The Game Collection". http://www.ozarksoftscape.com/the-game-collection.html.
17. ↑ Yakal, Kathy (June 1986). "The Evolution of Commodore Graphics". Compute!'s Gazette: 34–42. https://archive.org/details/1986-06-computegazette/page/n35. Retrieved 2019-06-18.
18. ↑ Kent, Steven (2001). The Ultimate History of Video Games. Three Rivers Press. p. 190. ISBN 0-7615-3643-4.
19. ↑ Kent, Steven (2001). "The Fall". The Ultimate History of Video Games. Three Rivers Press. pp. 237–239. ISBN 978-0-7615-3643-7.
20. ↑ "Stop making horrible console ports - a guide". PC Gamer. 2013. https://www.pcgamer.com/stop-making-horrible-console-ports-a-guide/.
21. ↑ Yarwood, Jack (2024-12-17). "The Making Of: Dragon's Lair's "Impossible" Game Boy Color Port" (in en-GB). https://www.timeextension.com/features/the-making-of-dragonrs-lairrs-impossible-game-boy-color-port.
22. ↑ Minor, Jordan (2020-06-29). "The Beauty of the Impossible Nintendo Switch Port" (in en). https://www.pcmag.com/opinions/the-beauty-of-the-impossible-nintendo-switch-port?test_uuid=04IpBmWGZleS0I0J3epvMrC&test_variant=A.
23. ↑ Cryer, Hirun (2022-10-06). "Nier Automata's Switch port might actually be the best place to play the 2017 game" (in en). https://www.gamesradar.com/nier-automatas-switch-port-might-actually-be-the-best-place-to-play-the-2017-game/.

* Richards, Martin; Whitby-Strevens, Colin (1984). BCPL, the language and its compiler. Cambridge University Press. ISBN 0-521-28681-6.
* Tanenbaum, Andrew S. (1984). Structured computer organization. Prentice Hall. ISBN 0-13-854605-3.

de:Portierung

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Porting. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Porting&oldid=4298819"