Write once, compile anywhere
   HOME

TheInfoList



OR:

Write once, compile anywhere (WOCA) is a
philosophy Philosophy (from , ) is the systematized study of general and fundamental questions, such as those about existence, reason, knowledge, values, mind, and language. Such questions are often posed as problems to be studied or resolved. Some ...
taken by a
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
and its associated
software libraries In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and subro ...
or by a software library/
software framework In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard ...
which refers to a capability of writing 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 program ...
that can be compiled on all
platform Platform may refer to: Technology * Computing platform, a framework on which applications may be run * Platform game, a genre of video games * Car platform, a set of components shared by several vehicle models * Weapons platform, a system or ...
s without the need to modify its
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the wo ...
. As opposed to Sun's ''
write once, run anywhere Write once, run anywhere (WORA), or sometimes Write once, run everywhere (WORE), was a 1995 slogan created by Sun Microsystems to illustrate the cross-platform benefits of the Java language. Ideally, this meant that a Java program could be develope ...
'' slogan,
cross-platform 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 r ...
compatibility is implemented only at the source code level, rather than also at the compiled
binary code A binary code represents text, computer processor instructions, or any other data using a two-symbol system. The two-symbol system used is often "0" and "1" from the binary number system. The binary code assigns a pattern of binary digits, also ...
level.


Introduction

There are many languages that follow the WOCA philosophy, such as
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
,
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
(see
Free Pascal Free Pascal Compiler (FPC) is a compiler for the closely related programming-language dialects Pascal and Object Pascal. It is free software released under the GNU General Public License, witexception clausesthat allow static linking against it ...
),
Ada Ada may refer to: Places Africa * Ada Foah, a town in Ghana * Ada (Ghana parliament constituency) * Ada, Osun, a town in Nigeria Asia * Ada, Urmia, a village in West Azerbaijan Province, Iran * Ada, Karaman, a village in Karaman Province, Tur ...
,
Cobol COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily us ...
, or C, on condition that they don't use functions beyond those provided by the
standard library In computer programming, a standard library is the library made available across implementations of a programming language. These libraries are conventionally described in programming language specifications; however, contents of a language's as ...
. Languages like Go go even further in as far that no system specific things are used, it should just work, and for system-specific elements a system of platform-specific files is used. A computer program may also use cross-platform libraries, which provide an
abstraction layer In computing, an abstraction layer or abstraction level is a way of hiding the working details of a subsystem. Examples of software models that use layers of abstraction include the OSI model for network protocols, OpenGL, and other graphics libra ...
hiding the differences between various platforms, for things like sockets and
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
, ensuring the portability of the written source code. This is, for example, supported by Qt (C++) or the Lazarus (Pascal) IDE via its LCL and corresponding
widgetset Widgetsets support platform-sensitive development with the Lazarus IDE system. They act as adapter libraries that provide an interface between a platform-inpedentent sourcecode written in Free Pascal and platform-specific system functions. Thus ...
s. Today, we have very powerful desktop computers as well as computers in our phones, which often have sophisticated applications such as
word processing A word is a basic element of language that carries an objective or practical meaning, can be used on its own, and is uninterruptible. Despite the fact that language speakers often have an intuitive grasp of what a word is, there is no consen ...
,
Database management In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases span ...
, and
spreadsheet A spreadsheet is a computer application for computation, organization, analysis and storage of data in tabular form. Spreadsheets were developed as computerized analogs of paper accounting worksheets. The program operates on data entered in cel ...
s, that can allow people with no programming experience to, sort, extract, and manipulate their data. and create documents (such as
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
files) showing their now organized information, or printing it out. Before 2000, some of these were not available, and prior to 1980, almost none of them were. From the start of computer automation in the early 1960s, if you wanted a report from data you had, or needed to print up
invoice An invoice, bill or tab is a commerce, commercial document issued by a sales, seller to a buyer relating to a sale transaction and indicating the product (business), products, quantities, and agreed-upon prices for products or Service (economic ...
s, payroll checks,
purchase order A purchase order is a commercial document and first official offer issued by a buyer to a seller, indicating types, quantities, and agreed prices for products or services. It is used to control the purchasing of products and services from externa ...
s, and other paperwork businesses, schools and governments generated, you typed them up on a physical typewriter, possibly using pre-printed forms. Otherwise, if you did have information stored in a computer, and wanted it sorted, manipulated, or printed, it required someone to write a program to do so. In some cases, the person needed information that professional programmers either could not understand how to provide a program to do what they wanted; the available programmers could not produce something in a reasonable amount of time; or there weren't any programmers they could use, caused some non-programming professionals to learn some programming skills, at least to know how to manipulate and print out information they needed from their data. Whether the work was done by a professional programmer, or an
end-user In product development, an end user (sometimes end-user) is a person who ultimately uses or is intended to ultimately use a product. The end user stands in contrast to users who support or maintain the product, such as sysops, system administrat ...
writing a program to provide them information for their own use, the means to do this in either case is the same. Write a program, submit it to a
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
(another program that converts written programs into instructions the computer can understand), fix any errors, then repeat until the program worked. While this helped fix part of the problem, it created a new one. People who wrote programs, or hired someone to write them (purchasing software was not a thing until the 1970s or 1980s), discovered when their employer or school bought a new computer, their programs no longer worked.


History

Originally, programming at the written level was done by writing programs in
assembly language In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
. The problems with this are that * It is the ultimate in
vendor lock-in In economics, vendor lock-in, also known as proprietary lock-in or customer lock-in, makes a customer dependent on a vendor for products, unable to use another vendor without substantial switching costs. The use of open standards and alternative ...
as your programs are not only tied to that vendor's hardware, but to that particular model of that manufacturer's hardware. * If you want to move to a more capable or more powerful machine, your code might not work, requiring everything to be done over. * If your vendor goes out of business, or does not provide a better model, when you want to upgrade you have to move to another vendor's equipment, and your entire investment is lost, for the same reason as the previous example. * Assembly language is slow to develop. A program in a
high-level language In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ''elements'', be easier to us ...
today, (like
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
,
PHP PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group ...
, or Go) can have one line of code that would require dozens of assembly-language statements. * Many people who want to develop solutions for a particular problem and want to create a program to do so, may not want to take the time to learn the machine language of a computer, but would be willing to learn to learn to write programs to solve their problems using something less complicated.


Development of high-level programming languages

To combat these problems, various
high-level language In computer science, a high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ''elements'', be easier to us ...
s were developed that were usable for general purpose application program development, but could be used to provide reports and information for people with specialized requirements. These include: *
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
, a simplified programming language which could be used to build "real world" complex applications, as well as simple programs to solve a problem, and was very accessible for amateur programmers. Its ease of use made BASIC well suited as an introductory computer programming class in many colleges. * C, a
general-purpose programming language In computer software, a general-purpose programming language (GPL) is a programming language for building software in a wide variety of application domains. Conversely, a domain-specific programming language is used within a specific area. For exam ...
often suitable for writing programs which would otherwise require assembly language. *
Cobol COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily us ...
, a general-purpose programming language which tended to be used for developing business applications. * Fortran, a general-purpose programming language which is well suited for scientific and engineering problems. *
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
, a general-purpose programming language, which tended to be targeted toward use in schools as an introductory class to teach programming as an alternative to BASIC. Pascal became commonly used for hobbyist programmers in the 1970s and 1980s due to them being part of an
integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools a ...
allowing a person to edit, compile, and run their programs, providing immediate results. Programs such as
UCSD Pascal 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 (UCS ...
and
Turbo Pascal Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the Pascal (programming language), Pascal programming language running on CP/M, CP/M-86, and DOS. It was originally develo ...
opened up the world of programming to millions of people, * RPG, a
domain-specific programming language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
designed to take the contents of data files, manipulate data and do calculations, then produce printed reports, similar to the way a person can use a spreadsheet to organize data and create
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
files today. While
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
s and interpreters of all of these languages, and dozens of others, were available for different machines and different vendors, often each manufacturer would develop proprietary enhancements which made programing on that machine easier, but again, made programs difficult to port (move the program to a different type of computer or a different vendor's computers), and increased vendor lock in. Something had to change.


Standardization

Starting in the late 1960s and early 1970s, efforts came into play to create standards and specifications of how machine-independent programs could be written using compilers from any vendor. Standards-making organizations, like the
International Standards Organization The International Organization for Standardization (ISO ) is an international standard development organization composed of representatives from the national standards organizations of member countries. Membership requirements are given in Art ...
(ISO), and
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
, among others, in cooperation with large users of computers and software (like governments, financial institutions and manufacturers), and computer manufacturers, to create standardized specifications to provide a description of how each specific language should be implemented. Computer manufacturers could still have their own proprietary extensions to a programming language, if they wanted to be able to claim compliance with the standard, in their reference manual they had to identify what was different, so that a program written according to the standard, would be able to compile and operate on their machine would also operate, without further change, on a different manufacture's computer, if their compiler also followed the standard. The requirements of the standard were enforced by large software buyers, such as military, government, and manufacturing companies, to refuse to buy their computing equipment, if they had a compiler for the programming languages they used, if it was not compliant with the standard,


Results

Currently, there are more than a dozen programming languages that have standards describing how programs in the language are supposed to be written, including
Ada Ada may refer to: Places Africa * Ada Foah, a town in Ghana * Ada (Ghana parliament constituency) * Ada, Osun, a town in Nigeria Asia * Ada, Urmia, a village in West Azerbaijan Province, Iran * Ada, Karaman, a village in Karaman Province, Tur ...
, APL,
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
,
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
,
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily us ...
,
ECMAScript ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262 ECMAScript is commonly used for client-side scripting o ...
(the generic name for
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 ...
),
Forth Forth or FORTH may refer to: Arts and entertainment * ''forth'' magazine, an Internet magazine * ''Forth'' (album), by The Verve, 2008 * ''Forth'', a 2011 album by Proto-Kaw * Radio Forth, a group of independent local radio stations in Scotla ...
, FORTRAN,
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Fren ...
,
PL/I PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language developed and published by IBM. It is designed for scientific, engineering, business and system programming. I ...
,
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sa ...
and SQL. Many of these are still in use, in some cases, because customers were able to take their source code to a different manufacturer's computer, where it was recompiled, often without change, because of the standardization of programming languages. While the standards helped, the WOCA philosophy works only when the makers of compilers ensure that they follow the standard.


See also

*
Pivot language A pivot language, sometimes also called a bridge language, is an artificial or natural language used as an intermediary language for translation between many different languages – to translate between any pair of languages A and B, one translates ...
{{DEFAULTSORT:Write Once, Compile Anywhere Software engineering folklore Computer programming folklore Programming language folklore Interoperability