Insoftware development,porting is the process of changingsoftware to work well in a different place. It can mean changingsource code so that aprogram can work well on a differentplatform or with a differentCPU. Or, it can mean changing it for a place that has a differentlibrary orframework. It can also mean taking something from onecodebase and putting it in a different one. This can be done with two different forms of the same software.[1]
Software is said to be portable if it can be used in a different place with no change to the code. It can also be portable if the price of changing it to work in a different place is less than the price of making it all over again. If the price to change it is very low and the price to make it again is very high, the software is very portable. The amount of changes needed is based on many things, such as how different the old place is from the new place, how well the code makers work, and how portable the codebase is.
The amount of CPUs andoperating systems that are very different from each other is much smaller now than in the past. Thex86architecture is now used on most computers. This means that most software is never ported to a different CPU. There are also only three common operating systems used:Microsoft Windows,macOS, andLinux. However, when usingembedded systems ormobile systems,portability is still very important. TheARM architecture is commonly used in those places.
Groups such as theISO help porting by giving certain rules about computers and programs. If the rules are used, it is easier to make portable software even when different places use different systems. Making software that uses those rules is very useful but can be hard. Porting a program that uses the rules well can be very easy if it is possible to simply copy the code to the new place. It can be harder if small things need to be changed because of small differences between the old and new places. Most rules have "gray areas", meaning different people will think they mean different things. This causes people to use the rules differently in different places.
More and more, people are making tools and software to help with porting. For example theGNU Compiler Collection gives the sameprogramming languages in different places, andAutotools, which looks for small differences between old and new places and makes the necessary changes.
Thecompilers for somehigh-level programming languages (e.g.Eiffel,Esterel) are more portable because they change the source code to be a high levelintermediate language (such asC). This makes them able to be used on many different computers.