Run WASM in Raspberry Pi 4 Today

WebAssembly (WASM) can run in almost all OS and architect, including Raspberry Pi. However, at the time of my test (Mar 1, 2020), only the wasmer claim and successfully run on my Pi 4. Other runtimes are either in planned mode or WIP.

I would like to share some of my experiences running WASM in Raspberry PI4 and some mistakes I made during the test. I hope it can help you if you want to try the same thing on your Pi.

Disclaimer: WASM is a rapidly growing community and new tools new builds coming up every day. All the experiences I shared with you today may not be valid at the time you read it. So please take it on your own.

Wasmtime is the first runtime I tried. But it doesn’t support ARM yet. Currently, only x86–64 works with Wasmtime. I know some other day it will work on ARM.

WAVM claimed the AArch64 support is in WIP (Work in Progress)mode, so I only tried on my Mac. It works excellent, just not on my Pi.

So Wasmer seems to be the only choice. I also read others blogs about the successful running Wasmer on Pi. So I tried on my own.

The Raspbian OS comes with my Pi is 32 bit, although the Pi’s hardware is 64 bit. I guess it is due to compatibility concerns. Others suggest switch existing Raspbian’s kernel to 64 bit by adding a line

arm_64bit=1

to the config.txt in /boot directory. (Reference: https://medium.com/@kavoshex/raspian-added-support-for-64-bit-kernel-6cf27c2b26db)

--

--