Wednesday, April 30, 2014

FFI for ARM

If you follow the Squeak and Pharo development yoou may know that there is a package called "FFI". This package provides a foreign function interface so you can call external modules on your operating system like Windows, Linux and Mac. So you were able to call external shared libraries, for instance a DLL written in C. FFI was originally written by Andreas Raab.

After FFI there was another package called "Alien", designed and implemented by Eliot Miranda which had additional support for callback.

After all that there was a new external interface implemented by Igor Stasenko for Pharo called NativeBoost, that not only allows to call external functions but if you like directly generate native assembler code using the AsmJIT port for Pharo.

While FFI was and still is a loadable and usable package in Squeak and Pharo, the newer NativeBoost (NB) package is now also part of the standard Pharo image. There will also be a chapter on NB in the upcoming Pharo Enterprise Book.

Most of this work is bound to x86 CPU architecture (I know was/is work going on to provide ARM support in AsmJit as well).

But this is just a summary of the history and current state. What is new is:

As you know new devices like the famous RaspberryPi run ARM processors. Now Douglas McPherson provided/announced initial FFI support for ARM architecture this week and the VM maintainers currently integrate.

All existing FFI tests now already pass for ARM (at least on Raspberry Pi). Really cool!



No comments: