''Write once, compile anywhere'' (WOCA) is a
philosophy
Philosophy ('love of wisdom' in Ancient Greek) is a systematic study of general and fundamental questions concerning topics like existence, reason, knowledge, Value (ethics and social sciences), value, mind, and language. It is a rational an ...
taken by a
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
and its associated
software libraries
In computing, a library is a collection of resources that can be leveraged during software development to implement a computer program. Commonly, a library consists of executable code such as compiled functions and classes, or a library can ...
or by a software library/
software framework
In computer programming, a software framework is a software abstraction that provides generic functionality which developers can extend with custom code to create applications. It establishes a standard foundation for building and deploying soft ...
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 Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
that can be compiled on all
platforms without the need to modify its
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
. 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 (programming language), Java programming language. Ideally, ...
'' slogan,
cross-platform
Within 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 platform, computing platforms. Some ...
compatibility is implemented only at the source code level, rather than also at the compiled
binary code
A binary code represents plain text, text, instruction set, 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, binary number system. The binary cod ...
level.
Introduction
There are many languages that aim to allow developers to follow the WOCA philosophy, such as
C++,
Pascal (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,
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 ...
, 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 (computing), library made available across Programming language implementation, implementations of a programming language. Often, a standard library is specified by its associated program ...
. 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, 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
widgetsets.
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 processor (WP) is a device or computer program that provides for input, editing, formatting, and output of text, often with some additional features.
Word processor (electronic device), Early word processors were stand-alone devices dedicate ...
,
Database management
In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and ana ...
, 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 c ...
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 Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
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, tab, or bill of costs is a commercial document that includes an itemized list of goods or services furnished by a seller to a buyer relating to a sale transaction, that usually specifies the price and terms of sale, quanti ...
s, payroll checks,
purchase order
A purchase order, often abbreviated to PO, is a commercial document issued by a buyer to a seller, indicating types, quantities, and agreed prices for products or services required. It is used to control the purchasing of products and services ...
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 administrato ...
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 Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
(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.
Development of high-level programming languages
To combat these problems, various
high-level language
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 use, or may automate (or ...
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 or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
, 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 Domain (software engineering), domains. Conversely, a Domain-specific language, domain-specific pro ...
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 ...
, 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, 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 Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
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 (UC ...
and
Turbo Pascal
Turbo Pascal is a software development system that includes a compiler and an integrated development environment (IDE) for the programming language Pascal (programming language), Pascal running on the operating systems CP/M, CP/M-86, and MS-DOS. ...
opened up the world of programming to millions of people,
*
RPG
RPG may refer to:
Military
* Rocket-propelled grenade, a shoulder-launched anti-tank weapon
**''Ruchnoi Protivotankoviy Granatomyot'' (Russian: ''Ручной Противотанковый Гранатомёт''), hand-held anti-tank grenade laun ...
, 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 Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
files today.
While
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
s and
interpreter
Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
s 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 (ISO), and
ANSI
The American National Standards Institute (ANSI ) is a private nonprofit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organiz ...
, 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, but if they wanted to be able to claim compliance with the standard, they had to specify the differences in the reference manual, so that a program written according to the standard able to compile and operate on their machine would also operate, without further change, on a different manufacturer's computer whose compiler also followed the standard. The requirements of the standard were enforced by large software buyers, such as military, government, and manufacturing companies, by refusing to buy such computing equipment if the vendor only offered a compiler for the programming languages they used which wasn't 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,
APL,
BASIC
Basic or BASIC may refer to:
Science and technology
* BASIC, a computer programming language
* Basic (chemistry), having the properties of a base
* Basic access authentication, in HTTP
Entertainment
* Basic (film), ''Basic'' (film), a 2003 film
...
,
C++,
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 ...
,
ECMAScript
ECMAScript (; ES) is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is stan ...
(the generic name for
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
),
Forth,
FORTRAN,
Pascal,
PL/I
PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has b ...
,
Ruby
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 sapph ...
and
SQL
Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel")
is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
. 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
{{DEFAULTSORT:Write Once, Compile Anywhere
Software engineering folklore
Computer programming folklore
Programming language folklore
Interoperability
Software development philosophies