In the last months, we have been working on the implementation of a MIT-licenced ARMv8 Just-In-Time compiler for Pharo VM.
We would like to announce that a beta first version of our JIT backend is available for beta-testing for ARM Linux and Windows machines.
We are very happy with the advance in this subject, as we have not only implemented a new backend but we have added more than 2500 tests of the JIT, the primitives, code generation, plugins, and the VM in general. Also, we are generating a lot of documentation and improving the process to really democratize the development of the VM.
After all the text there are details on how to obtain the versions for testing it.
The following sections give more details of the current status, and the following steps including Apple Silicon, Windows, and Linux ARM64.
Current Status
Our objective is to have a running JIT for the new aarch64 architecture (ARM 64bits). This task includes not only a new backend for the JIT compiler but also adding support for external libraries, dependencies, and the build process. This means having a working VM with comparable features as the one existing in Intel X64. We are targeting all the major operating systems running on this platform (Linux, OSX, Windows). Each of them presents different restrictions and conditions.
After expending some time this is the current status:
- We implemented a full backend for the JIT compiler targeting aarch64.
- All the image side was adapted to run on it, tested on Ubuntu ARM 64 bits.
- We added support for: Iceberg (Libgit) / Athens (Cairo) / SDL / GTK
- We implemented a LibFFI based FFI backend as the default one for Pharo 9 in aarch64 (next to come in all platforms). This opens the door to easily port the features to other platforms and OSes. This new implementation does not have an impact on performance as it has comparable results with the old implementation. Much more, this implementation opens also the door to have runners in different threads than the VM thread (non-blocking FFI).
Status By Platform
Linux
We have a working version of the VM. It is using the same code-base and build process for both architectures (Intel X64 / ARM aarch64). A version can be compiled and executed in all the platforms. Also, we have integrated the build using Open Build Services (OBS) to generate packages for all the mainstream distributions.
Currently, the version for Debian-like systems (Debian, Ubuntu, Raspberry pi OS, etc) is available and ready to beta test; the details for installing them are in the end of the mail. Versions for ARCH-based and RPM-based systems are in the working (If you want to get them or to test them please contact us, so we can pass on the detail of how to get them).
Windows
We have extended the build process to fully support Microsoft Visual Studio compilers and more flexibility to select the targets, also we are building it to run in Windows ARM. To correctly run the VM in Windows it is needed to build all dependencies for aarch64.
In this path, we have a working Intel x64 version with Cygwin and MSVC, and a MSVC version for aarch64 (ARM64).
The ARM64 version is available to be beta-testing on machines with this architecture.
The Details are at the end of the mail.
OSX
Our third target is to have a working version for the newest Apple silicon. We are acquiring the corresponding hardware to test and to address the differences in the API exposed to JIT applications. As it is the case of the Windows VM, there is no need to change the machine code generation backend, as it is the same that has been implemented for Linux; but to compile external libraries and particularities of the new OS version.
Thanks for your support. In the meantime, we will continue giving you news about the current state and where are we going.
For Debian like distributions, the instructions are the following.
1) Add a new APT source, usually modifying a file in /etc/apt/sources.list.d/, for example, we can add the pharo.list file with the following content. Also, we need to register the key of the repository. These steps should be done only once. We are giving a little script for modifying the configuration. It is only needed to execute line by line.