Write once, run anywhere

Last updated

Write once, run anywhere (WORA), or sometimes Write once, run everywhere (WORE), was a 1995 [1] slogan created by Sun Microsystems to illustrate the cross-platform benefits of the Java language. [2] [3] Ideally, this meant that a Java program could be developed on any device, compiled into standard bytecode, and be expected to run on any device equipped with a Java virtual machine (JVM). The installation of a JVM or Java interpreter on chips, devices, or software packages became an industry standard practice.

A programmer could develop code on a PC and expect it to run on Java-enabled mobile phones, as well as on routers and mainframes equipped with Java, without any adjustments. This was intended to save software developers the effort of writing a different version of their software for each platform or operating system they intend to deploy on.

This idea originated no later than the 1960s, with the IBM M44/44X, and in the late 1970s the UCSD Pascal system was developed to produce and interpret p-code. UCSD Pascal (along with the Smalltalk virtual machine) was a key influence on the design of the JVM, as is cited by James Gosling.[ citation needed ]

The catch is that since there are multiple JVM implementations, on top of a wide variety of different operating systems, there could be subtle differences in how a program executes on each JVM/OS combination, possibly requiring an application to be tested on each target platform. This gave rise to a joke among Java developers: Write Once, Debug Everywhere. [4]

In comparison, the Squeak Smalltalk programming language and environment boasts of being truly write once run anywhere, [5] because it runs bit-identical images across its wide portability base. [6]

Like Squeak, MicroEJ provides a virtual execution environment that guarantees one unique Java thread policy across all implementations, ensuring a true WORA semantic across millions of devices.

See also

Related Research Articles

<span class="mw-page-title-main">Java applet</span> Small application written in Java

Java applets were small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode. The user launched the Java applet from a web page, and the applet was then executed within a Java virtual machine (JVM) in a process separate from the web browser itself. A Java applet could appear in a frame of the web page, a new application window, a program from Sun called appletviewer, or a stand-alone tool for testing applets.

<span class="mw-page-title-main">Java (programming language)</span> Object-oriented programming language

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. The Java runtime provides dynamic capabilities that are typically not available in traditional compiled languages.

<span class="mw-page-title-main">Smalltalk</span> Object-oriented programming language released first in 1972

Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.

<span class="mw-page-title-main">UCSD Pascal</span> Programming language released in 1977

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 (UCSD).

In computing, a virtual machine (VM) is the virtualization or emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination of the two. Virtual machines differ and are organized by their function, shown here:

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

Bytecode is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

Apache Harmony is a retired open source, free Java implementation, developed by the Apache Software Foundation. It was announced in early May 2005 and on October 25, 2006, the board of directors voted to make Apache Harmony a top-level project. The Harmony project achieved 99% completeness for J2SE 5.0, and 97% for Java SE 6. The Android operating system has historically been a major user of Harmony, although since Android Nougat it increasingly relies on OpenJDK libraries.

<span class="mw-page-title-main">Java (software platform)</span> Set of computer software and specifications

Java is a set of computer software and specifications that provides a software platform for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

<span class="mw-page-title-main">Seaside (software)</span> Smalltalk web framework

Seaside, an acronym that stands for “Squeak Enterprise Aubergines Server with Integrated Development Environment,” is computer software, a web framework to develop web applications in the programming language Smalltalk. It is distributed as free and open-source software under an MIT License.

<span class="mw-page-title-main">Squawk virtual machine</span>

Squawk is a Java micro edition virtual machine for embedded system and small devices. Most virtual machines for the Java platform are written in low level native languages such as C/C++ and assembler; what makes Squawk different is that Squawk's core is mostly written in Java. A Java implementation provides ease of portability, and integration of virtual machine and application resources such as objects, threads, and operating-system interfaces.

In computer programming, a green thread is a thread that is scheduled by a runtime library or virtual machine (VM) instead of natively by the underlying operating system (OS). Green threads emulate multithreaded environments without relying on any native OS abilities, and they are managed in user space instead of kernel space, enabling them to work in environments that do not have native thread support.

Memory footprint refers to the amount of main memory that a program uses or references while running.

Eclipse OpenJ9 is a high performance, scalable, Java virtual machine (JVM) implementation that is fully compliant with the Java Virtual Machine Specification.

The Java Development Kit (JDK) is a distribution of Java technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API). It is derivative of the community driven OpenJDK which Oracle stewards. It provides software for working with Java applications. Examples of included software are the Java virtual machine, a compiler, performance monitoring tools, a debugger, and other utilities that Oracle considers useful for Java programmers.

Java bytecode is the instruction set of the Java virtual machine (JVM), crucial for executing programs written in the Java language and other JVM-compatible languages. Each bytecode operation in the JVM is represented by a single byte, hence the name "bytecode", making it a compact form of instruction. This intermediate form enables Java programs to be platform-independent, as they are compiled not to native machine code but to a universally executable format across different JVM implementations.

Codename One is an open-source cross-platform framework aiming to provide write once, run anywhere code for various mobile and desktop operating systems. It was created by the co-founders of the Lightweight User Interface Toolkit (LWUIT) project, Chen Fishbein and Shai Almog, and was first announced on January 13, 2012. It was described at the time by the authors as "a cross-device platform that allows you to write your code once in Java and have it work on all devices specifically: iPhone/iPad, Android, Blackberry, Windows Phone 7 and 8, J2ME devices, Windows Desktop, Mac OS, and Web. The biggest goals for the project are ease of use/RAD, deep integration with the native platform and speed."

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK) written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead of time. This allows for faster initialization, greater runtime performance, and decreased resource consumption, but the resulting executable can only run on the platform it was compiled for. It provides additional programming languages and execution modes. The first production-ready release, GraalVM 19.0, was distributed in May 2019. The most recent release is GraalVM for JDK 21, made available in September 2023.

References

  1. "Write once, run anywhere?". ComputerWeekly.com. Retrieved 2022-10-05.
  2. "JavaSoft ships Java 1.0". Sun Microsystems. 1996-01-23. Archived from the original on 2007-03-10. Java's write-once-run-everywhere capability along with its easy accessibility have propelled the software and Internet communities to embrace it as the de facto standard for writing applications for complex networks
  3. "Write once, run anywhere?". Computer Weekly. 2002-05-02. Retrieved 2009-07-27.
  4. Wong, William (2002-05-27). "Write Once, Debug Everywhere". electronicdesign.com. Retrieved 2013-02-04. So far, the "Write-once, run-everywhere" promise of Java hasn't come true. The bulk of a Java application will migrate between most Java implementations, but taking advantage of a VM-specific feature causes porting problems.
  5. "Welcome To Squeak". Squeak. Retrieved 5 May 2015.
  6. "Back to the Future The Story of Squeak, A Practical Smalltalk Written in Itself". Dan Ingalls Ted Kaehler John Maloney Scott Wallace Alan Kay. Retrieved 5 May 2015.