Write once, compile anywhere (WOCA) is a philosophy taken by a software platform which refers to a capability of writing a computer program that can be compiled on all platforms without the need to modify its source code. As opposed to Sun's write once, run anywhere slogan, cross-platform compatibility is implemented only at the source code level, rather than also at the compiled binary code level.
There are many languages that follow the WOCA philosophy, such as C++, Pascal (see Free Pascal), Ada or C, on condition that they don't use functions beyond those provided by the standard library. 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 hiding the differences between various platforms, for things like sockets and GUI, ensuring the portability of the written source code. This is e.g. supported by Qt or the Lazarus IDE via its LCL and corresponding widgetsets.
Write once may refer to:
In cache coherency protocol literature, Write-Once was the first write-invalidate protocol defined. It has the optimization of executing write-through on the first write and a write-back on all subsequent writes, reducing the overall bus traffic in consecutive writes to the computer memory. It was first described by James R. Goodman in (1983). Cache coherence protocols are an important issue in Symmetric multiprocessing systems, where each CPU maintains a cache of the memory.
In this protocol, each block in the local cache is in one of these four states: