# Rosetta (software)

Rosetta is a dynamic binary translator developed by Apple Inc. for macOS, an application compatibility layer between different instruction set architectures. It enables a transition to newer hardware, by automatically translating software. The name is a reference to the Rosetta Stone, the artifact which enabled translation of Egyptian hieroglyphs.
The first version of Rosetta was introduced in 2006 in Mac OS X Tiger as part of the Mac transition from PowerPC processors to Intel processors, allowing PowerPC applications to run on Intel-based Macs. Support for Rosetta was dropped since Mac OS X Lion (10.7) in 2011. Rosetta 2 was introduced in 2020 as a component of macOS Big Sur, and as part of the Mac transition from Intel processors to Apple silicon, allowing Intel applications to run on Apple silicon-based Macs.

## Background

Macintosh has used CPUs with several different instruction set architectures (ISA): the Motorola 68000 series, PowerPC, Intel x86, and ARM64 in Apple silicon. Each ISA is incompatible, necessitating a transition plan based on a software layer to emulate the previous ISA on the succeeding one.
With the launch of Power Macintosh, the Mac 68K emulator is part of System 7.1.2 and later. This emulator uses PowerPC features and is embedded at the lowest levels of the operating system, integrated with the Mac OS nanokernel. This means that the nanokernel is able to intercept PowerPC interrupts, translate them to 68k interrupts (then doing a mixed mode switch, if necessary), and then execute 68k code to handle the interrupts. This allows 68k and PowerPC code to be interspersed within the same fat binary.

## Rosetta

Apple launched Rosetta in 2006 upon the Mac transition to Intel processors from PowerPC. It is in Mac OS X Tiger 10.4.4 "Tiger", the version that launched the x86-based Macs, and allows many unmodified PowerPC applications to automatically run on Intel-based Mac computers. Rosetta is based on QuickTransit technology. It has no graphical user interface, and launches transparently, which led Apple to describe Rosetta as "the most amazing software you'll never see". Rosetta is optionally installable in Mac OS X 10.6 "Snow Leopard". Rosetta is neither included nor supported in Mac OS X 10.7 "Lion" (released in 2011) or later.
Because of the greater architectural differences between Intel and PowerPC processors, Rosetta operates at a higher level than the 68000 emulator does, as a user-level program that can only intercept and emulate user-level code. It translates G3, G4, and AltiVec instructions, but not G5. Although most commercial software for PowerPC-based Macs was compatible with these requirements and G4 systems were still widely used, developers must update any applications that rely on G5-specific instructions to work on Rosetta. Apple advised that applications with heavy user interaction but low computational needs (such as word processors) would be best suited to use with Rosetta, and applications with high computational needs (such as games, AutoCAD, or Photoshop) would not.

## Rosetta 2

In 2020, Apple announced Rosetta 2 would be bundled with macOS Big Sur, to aid in the Mac transition to Apple silicon. The software permits many applications compiled exclusively for execution on x86-64-based processors to be translated for execution on Apple silicon.
In addition to the just-in-time (JIT) translation support, Rosetta 2 offers ahead-of-time compilation (AOT), with the x86-64 code fully translated, just once, when an application without a universal binary is installed on an Apple silicon Mac.
Rosetta 2's performance has been praised greatly. In some benchmarks, x86-64-only programs performed better under Rosetta 2 on M1 than native x86-64. One of the key reasons why Rosetta 2 provides such a high level of translation efficiency is the support of x86-64 memory ordering in the M1 SoC. The SOC also has dedicated instructions for computing x86 flags.
Since macOS Ventura, Linux guest operating system virtual machines can install Rosetta 2 as a guest runtime binary to run x86-64 Linux apps.