Microsoft Store
 

Cross-platform


 

A cross-platform (or platform independent) programming language, software application or hardware device works on more than one system platform (e.g. Unix, Windows and Macintosh). Examples of cross-platform languages are C, C++, Java, JavaScript, Perl, Python, Tcl, Erlang, Delphi+Kylix and REALbasic.

Related Topics:
Programming language - Software - Hardware - System platform - Unix - Windows - Macintosh - C - C++ - Java - JavaScript - Perl - Python - Tcl - Erlang - Delphi - Kylix - REALbasic

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Most computer languages in their pure sense are cross-platform - as a high-level, human readable way to instruct a CPU that there is no need to depend on any particular operating system. However, to do things such as create a graphical user interface (GUI) using the system widget set a program links to libraries, which may be particular to the developer's system. Although C++ itself is cross platform, a program written in C++ for Windows using the Win32 API would normally not compile on a Unix computer. There are also differences in how compiler writers interpret a language specification; in this case a program may require some attention before it be built for multiple systems.

Related Topics:
Graphical user interface - Widget set - Windows - Win32 - Unix

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Some programming languages such as Java were designed from the start to work on any platform that has a suitable virtual machine. Languages which use bytecode as the compiled representation or which interpret scripts directly do not need to be compiled for any particular operating system. Native libraries of the operating system are not linked to by the distributed code, rather the run time environment reimplements much of the same functionality or provides a common bridge to similar functions on different systems. It is possible to create Java programs which only run on a particular system, either by using JNI or by running a bytecode-to-machinecode compiler; this is not necessary for most tasks.

Related Topics:
Java - Virtual machine - JNI

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Providing and testing compiled versions of a program for every OS and CPU is practically impossible, so projects which are open source or otherwise allow the user to compile their own object code could be said to be more cross-platform. Likewise, languages which are interpreted or otherwise require a virtual machine are more cross-platform where individuals can compile their own. Hotspot, Sun's Java virtual machine, is provided only as compiled binaries, with support for several, but not all, platforms. For example, Sun only supports GNU/Linux on the i386 architecture - anyone running Linux on PowerPC or SPARC computers cannot use Java without compiling to native machinecode or using third party tools.

Related Topics:
Open source - Hotspot - Sun - GNU/Linux - I386 - PowerPC - SPARC

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Many APIs are platform specific. OpenGL can be said to be cross-platform because it is not tied to any particular operating system, CPU architecture or brand of graphics hardware. Platform specific APIs may be recreated on other systems as a compatibility layer, such as the WINE library, which allows programs requiring windows libraries to be used on UNIX.

Related Topics:
API - OpenGL - WINE

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

There are also cross-platform extensions and middleware for many programming languages that enable programmers to compile/run the same source code with minimal fixes on different platforms. Examples include Qt and wxWidgets.

Related Topics:
Middleware - Source code - Qt - WxWidgets

~ ~ ~ ~ ~ ~ ~ ~ ~ ~