Author columns

What is Rosetta 2? Explanation of Apple’s “magical” software

What is Rosetta 2? Explanation of Apple’s “magical” software

Apple’s move away from Intel processors to its own Arm-based processors has raised questions about the compatibility of existing software developed for Intel processors with the new devices. Rosetta 2 quickly allayed the fears of Apple’s first Silicon users, but what exactly is Rosetta 2 and how does it work? Why is it so important?”

What is Rosetta 2 and how does it work?

Rosetta 2 is a dynamic binary translator. To better understand this term, let’s break it down piece by piece. «Dynamic» means that Rosetta 2 runs at program execution time, not in advance. This is unlike a static translator, which tries to transform all of the program code before it runs. Static translation can be inefficient or even impossible for a number of reasons, as many modern applications use JIT (Just-in-Time) compilation, where code is generated directly at program runtime.

Many modern applications use JIT (Just-in-Time) compilation, where code is generated directly at program runtime.

In addition, applications often use libraries or external modules that are loaded only at certain points in the program’s execution, which also requires dynamic translation. Rosetta 2 translates code «on the fly» ensuring compatibility with Apple’s Silicon processors.

And Rosetta 2 translates code «on the fly» ensuring compatibility with Apple’s Silicon processors.

How does the broadcast process work?

The program you run on your Mac is a binary file – a finished program that the processor can execute. It’s called a binary because it’s made up of machine code-a set of instructions that the processor can execute directly. These instructions, written in a high-level programming language (such as C or Python), are compiled into machine code designed for a particular type of processor.

The Intel processors previously used in Macs supported the x86_64 instruction set, while Apple’s Silicon processors use the Arm instruction set. The instructions for each of these processors are different, so code written for one type of processor cannot be executed by the other without translation. Not only do Arm and Intel have different instructions, they also have different approaches to execution. Arm uses RISC (Reduced Instruction Set Computer) architecture, while Intel uses CISC (Complex Instruction Set Computer) architecture. These architectures execute instructions differently, and Rosetta 2 acts as a translator to ensure compatibility.

Why do we need Rosetta 2?

When you try to run an application written for Intel, Rosetta 2 dynamically translates its binary code into instructions that the Apple Silicon processor understands. It’s a complex process that involves not only simple instruction swapping, but also optimizing the application in real time so that it runs smoothly and efficiently.

And it’s a complex process that involves more than just simple instruction swapping, but also optimizing the application in real time so that it runs smoothly and efficiently.

Despite the high capabilities of Rosetta 2, the binary code it generates for Arm is usually not as efficient as code written specifically for Apple Silicon. Therefore, developers are advised to create native versions of their applications to maximize the capabilities of the new processors.

It is recommended that developers create native versions of their applications to maximize the capabilities of the new processors.

How to use Rosetta 2?

Using Rosetta 2 is very easy. The first time you run a program that requires Rosetta 2, you will be prompted to install this translator. It may take some time to load the program for the first time, as the initial translation of the code takes place. Afterward, the application will launch faster, almost as fast as Apple’s native Silicon applications.

Apple Silicon’s native applications.

Disadvantages of Rosetta 2

Although Rosetta 2 does the impossible, it is not a perfect solution and is not intended for permanent use. It serves as a temporary measure to ensure compatibility while developers create native versions of their apps. Translated apps will never run as fast as native apps, especially in performance-intensive programs like games or video editors.

While Rosetta 2 does the impossible, it’s a temporary measure to ensure compatibility while developers create native versions of their apps.

Some programs may not run correctly after translation because Rosetta 2 does not support all types of instructions. For example, it does not translate AVX, AVX2, and AVX512 instructions, nor does it work with applications that use kernel extensions or with virtual machines that emulate x86_64 platforms. Despite these limitations, Rosetta 2 does an impressive job of providing a smooth transition to Apple’s new technologies.

Closure

Rosetta 2 is an important element in Apple’s transition to its own processors. It ensures compatibility and allows users to enjoy their familiar software on new devices. However, over time, developers must move to building native apps to take full advantage of Apple Silicon. Rosetta 2 is a temporary bridge between the two architectures that allows users to comfortably adapt to the new generation of Macs.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

You may also like