<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Posts about ARM</title><link>https://chriswarrick.com/</link><atom:link href="https://chriswarrick.com/blog/tags/arm.xml" rel="self" type="application/rss+xml" /><description>A rarely updated blog, mostly about programming.</description><lastBuildDate>Sat, 14 Nov 2020 11:40:00 GMT</lastBuildDate><generator>https://github.com/Kwpolska/YetAnotherBlogGenerator</generator><item><title>What an ARM Mac means for developers and Windows users</title><dc:creator>Chris Warrick</dc:creator><link>https://chriswarrick.com/blog/2020/06/22/what-an-arm-mac-means-for-developers-and-windows-users/</link><pubDate>Mon, 22 Jun 2020 19:00:00 GMT</pubDate><guid>https://chriswarrick.com/blog/2020/06/22/what-an-arm-mac-means-for-developers-and-windows-users/</guid><description>
The rumor mill was right this time, and Apple has just announced they will
transition Macs to ARM processors. These news have some side effects for
software developers, particularly those not working with the Apple ecosystem.
And they also affect people who depend on both macOS and Windows.
</description><content:encoded><![CDATA[
<p>The rumor mill was right this time, and Apple has just announced they will
transition Macs to ARM processors. These news have some side effects for
software developers, particularly those not working with the Apple ecosystem.
And they also affect people who depend on both macOS and Windows.</p>



<p>In this post, I am not going to focus in the differences between x86_64 and ARM,
RISC and CISC, and all the benchmarks. Let’s assume that Apple manages to offer
ARM-based CPUs that can match performance of most Intel processors in Apple’s
lineup, and let’s even assume they can make an ARM Mac Pro. (A note on naming:
Apple Silicon is the official name, but it sounds ugly. I’ll just call it ARM.
For Intel, I’ll use either Intel or x86(_64).)</p>
<p>For many users, the transition will be more-or-less transparent. Sure, they’ll
lose some apps, just like they probably did with Catalina (which dropped
support for 32-bit Intel apps), or some apps will not be available/will be
buggy in the first few months of the transition (though it will be easier than
the PowerPC transition, because Apple uses little-endian byte order on ARM).</p>
<section id="how-will-it-work-out-in-apple-land">
<h1>How will it work out in Apple land?</h1>
<p>For developers who work only on iOS apps, the transition also won’t mean much.
Maybe a faster, more accurate Simulator. They’ll need to buy an ARM Mac sooner
or later (within the next 5 years), because Apple requires them to use the
latest Xcode version for App Store submissions, and Xcode supports at best the
previous version of macOS.  But that has been Apple’s policy forever, and the
Intel Macs will probably be within the usual deprecation range when that
happens.</p>
<p>The requirements for macOS-only developers are pretty obvious, they will need
to buy an ARM Mac on day one, so they can test their apps on the new platform.
They will also need to work on ARM compatibility — although updating your app
for the new OS is a yearly ritual in Apple land, so that’s also mostly
business-as-usual (unless you do a lot of unportable low-level stuff in your
code). There are some pro apps that tend to lag behind new Apple decrees (some
might have been hit by Catalina), and users of those apps might prefer to stay
with Intel for a little bit longer.</p>
<p>But then, we get to the requirements of developers who use Macs, but don’t work
exclusively with the Apple platforms. This is a fairly large group, since many
developers like Macs for the good hardware, Unix-based software, and the
integration of both. And for some part, non-developers are affected too.</p>
</section>
<section id="who-needs-non-apple-operating-systems">
<h1>Who needs non-Apple operating systems?</h1>
<p>The first group are people tied to Windows, somehow. Some of them might be
using Boot Camp to play games. Others might be using Boot Camp or
virtualization software (Parallels Desktop, VMware Fusion, Oracle VM
VirtualBox) to run Windows and Windows-specific apps — perhaps they need the
Windows version of Office, or various Windows-onlypro apps, or they need
Windows to file their taxes, because their government does not care about
non-Windows OSes. Or perhaps they’re web developers, and they need to test
compatibility with the Windows versions of browsers, or the old Microsoft
browsers (IE and pre-Chromium Edge).</p>
<p>The second group is software developers who need Linux. While macOS provides a
very competent development environment, and many things can be run directly on
macOS, some use-cases may require a Linux VM.  Perhaps the most notable case is
Docker.</p>
<p>Docker is a solution for lightweight app containers, that can offer separation
between apps, and that can simplify and standardize deployment. Docker itself
is not a virtualization solution (at least in the traditional sense). Docker
must run on top of Linux (there’s also Docker-on-Windows, but that’s another
story). The Docker Desktop for Mac app runs a lightweight Linux VM, and runs
containers in that VM. The virtualization solution <a class="reference external" href="https://github.com/docker/for-mac">Docker for Mac uses</a> is <code class="docutils literal">Hypervisor.framework</code>, which is
part of macOS itself.</p>
<p>Who else needs virtualization? Android developers. The Android Emulator is also
a virtual machine that runs the Android operating system. Android can run on
different architectures, and so, a x86 system image is typically used for the
Emulator.</p>
</section>
<section id="is-virtualization-possible-on-arm">
<h1>Is virtualization possible on ARM?</h1>
<p>Yes, definitely. Apple has been testing it much earlier, since the
aforementioned <code class="docutils literal">Hypervisor.framework</code> was found <a class="reference external" href="https://twitter.com/never_released/status/1250533740557852674">on iOS in April</a>.
And Apple announced virtualization support for ARM Macs during the keynote, and
showed an example of a Linux VM. That VM was, of course, running an ARM64
distribution of Linux.</p>
<p>But what can we use this for? Turns out, it’s complicated. The easiest thing
from the few use-cases mentioned before is Android. Google just needs to get
the Emulator working on ARM Macs and ship that to the devs.</p>
<p>What about Linux in general? Many mainstream distributions
support ARM64, so that’s not a problem in general. The support for a particular
distro or software might be worse than on x86_64, but it’s generally not a
problem for users.</p>
<p>But for Docker, there’s a problem. One of the many advantages of Docker is
dev-prod parity. If you deploy your app with Docker to an x86_64 Linux server,
you can also install Docker on an x86_64 Linux developer machine (or a Linux VM on an
Intel Mac/Windows PC). Both the server and the dev machine can run <strong>the same</strong>
image, the same code, the same configuration. That won’t happen if they are a
different architecture. This means that you can end up with bugs happening
because of different environments, and it’s also possible that some images you
depend on are not available for both architectures.</p>
<p>And then we get to Windows. Windows also has an ARM version, but it’s currently
available only with a new ARM device (you can’t buy it standalone). If
Microsoft were to sell this, we’d have an issue with the software. Windows 10
on ARM supports 32/64-bit ARM software, and can run 32-bit Intel (x86) software
using emulation. It cannot, however, emulate apps that require 64-bit Intel
processors (x86_64).  This makes the software situation on that platform a bit
better. While many developers don’t care about ARM and might not have builds
for ARM available, most Windows software is available in both x86 and x86_64
versions, or is exclusively 32-bit. But certain pro apps are x86_64 only, so if
there is no ARM build of it, an ARM Windows PC currently cannot run it.
(<em>Update:</em> Microsoft announced <a class="reference external" href="https://blogs.windows.com/windowsexperience/2020/09/30/now-more-essential-than-ever-the-role-of-the-windows-pc-has-changed/">x86_64 emulation on ARM</a>,
which means more software will work.)</p>
<p>And note that Microsoft knows about the transition, but we haven’t heard
anything about Windows during the keynote…</p>
</section>
<section id="can-we-emulate-x86-64-and-run-x86-64-windows-10">
<h1>Can we emulate x86(_64) and run x86(_64) Windows 10?</h1>
<p>Theoretically? Yes. Practically? No.</p>
<p>The issue with emulation is speed. There are a few x86 emulators available, and
those emulators can be run on an ARM device just fine. You can find videos on
YouTube (not a very reliable source of information, I know) in which people try
to benchmark those, or try to run Windows using an emulator like that. And even
with an ancient Windows version, the emulation is painfully slow. Windows 10
would be basically unusable if you tried to emulate all of it.</p>
<p>How does the x86 emulation on Windows 10 for ARM work? You can watch <a class="reference external" href="https://channel9.msdn.com/Events/Build/2017/P4171">the
Channel 9 video about Windows 10 on ARM</a> (around 6:00) for more
details. The trick is that system DLLs are using a hybrid x86/ARM64 library
format, which means x86 code can call those DLLs at native speeds. This means
that many apps run at near-native speed (depending on the ratio of custom code
to system DLL calls). This technique cannot work for emulating the entire
operating system. If Windows 10 on ARM was made available for ARM Macs, running
x86 Windows apps would become feasible.</p>
<p>Rosetta probably uses similar technique. Most apps will be translated at
install time, not at run time. But you can’t do that with an entire OS.</p>
</section>
<section id="whats-next-for-people-who-rely-on-both-macos-and-windows">
<h1>What’s next for people who rely on both macOS and Windows?</h1>
<p>For a few more years, Intel Macs will still be supported by Apple (with new
macOS versions) and by software vendors. But after that? Well, you’re stuck
with two machines, at least until Windows on ARM becomes viable and runnable on
Macs. Or you can start exploring alternatives to macOS software. If you’re one
of the macOS-as-UNIX-with-great-UX developers (hello!), perhaps you’ll have to
switch to Linux — or perhaps Windows with Windows Subsystem for Linux? (The
latter is becoming more usable with every Windows release, so keep an eye on
that… I wrote this post in NeoVim in WSL2, with Windows Terminal supporting
many advanced terminal features, and the transparent filesystem integration
letting me access Windows files directly).</p>
</section>
<section id="post-m1-announcement-update-2020-11-14">
<h1>Post-M1 announcement update (2020-11-14)</h1>
<p>Parallels have confirmed <a class="reference external" href="https://www.parallels.com/blogs/parallels-desktop-apple-silicon-mac/">support for M1 Macs</a> and
are offering a Technical Preview of their M1 virtualization product. This
announcement’s mention of Windows 10 ARM supporting x86_64 apps has caused
some tech writers to assume Parallels will support Windows 10 ARM on M1
Macs. This is <strong>not</strong> what the post says. Parallels is not, and cannot
announce support for that OS, because Windows 10 ARM is (still) available to
ARM OEMs only to install on their devices — making an official announcement
about this feature today would be admitting to doing something illegal/not
allowed by the EULA. I’m pretty sure they are not working on support for
Windows 10 ARM now and in the foreseeable future, until Microsoft opens up
Windows 10 ARM to the public — their own legal issues aside, who would they sell
the Windows support to?</p>
<p>In other news, <a class="reference external" href="https://github.com/docker/for-mac/issues/4733">Docker is not ready yet</a>.</p>
</section>
]]></content:encoded><category>Apple</category><category>Apple</category><category>ARM</category><category>devel</category><category>Mac</category></item></channel></rss>