WasmAndroid: a cross-platform runtime for native programming languages on Android (WIP paper)

Open-source hardware such as RISC-V has been gaining substantial momentum. Recently, they have begun to embrace Google's Android operating system to leverage its software ecosystem. Despite the encouraging progress, a challenging issue arises: a majority of Android applications are written in native languages and need to be recompiled to target new hardware platforms. Unfortunately, this recompilation process is not scalable because of the explosion of new hardware platforms. To address this issue, we present WasmAndroid, a high-performance cross-platform runtime for native programming languages on Android. WasmAndroid only requires developers to compile their source code to WebAssembly, an efficient and portable bytecode format that can be executed everywhere without additional reconfiguration. WasmAndroid can also trans-pile existing application binaries to WebAssembly when source code is not available. WebAssembly's language model is very different from C/C++ and this mismatch leads to many unique implementation challenges. In this paper, we provide workable solutions and conduct a preliminary system evaluation. We show that WasmAndroid provides acceptable performance to execute native applications in a cross-platform manner.

[1]  Alon Zakai Fast Physics on the Web Using C++, JavaScript, and Emscripten , 2018, Computing in Science & Engineering.

[2]  Umakishore Ramachandran,et al.  An execution model for serverless functions at the edge , 2019, IoTDI.

[3]  Andrew Waterman,et al.  Design of the RISC-V Instruction Set Architecture , 2016 .

[4]  James Tandon The OpenRISC processor: open hardware and Linux , 2011 .

[5]  Alon Zakai Emscripten: an LLVM-to-JavaScript compiler , 2011, OOPSLA Companion.

[6]  Luc Bläser,et al.  Accelerate JavaScript applications by cross-compiling to WebAssembly , 2017, VMIL@SPLASH.

[7]  Gerald Weber,et al.  BrowserVM: Running Unmodified Operating Systems and Applications in Browsers , 2020, 2020 IEEE International Conference on Web Services (ICWS).

[8]  Alon Zakai,et al.  Bringing the web up to speed with WebAssembly , 2017, PLDI.

[9]  Sylvain Ratabouil Android NDK Beginner’s Guide , 2012 .

[10]  Xiaosong Zhang,et al.  JN-SAF: Precise and Efficient NDK/JNI-aware Inter-language Static Analysis Framework for Security Vetting of Android Applications with Native Code , 2018, CCS.

[11]  Nicholas D. Matsakis,et al.  The rust language , 2014, HILT '14.

[12]  Martin Jacobsson,et al.  Virtual Machine Execution for Wearables Based on WebAssembly , 2018, BODYNETS.

[13]  Dominique Fober,et al.  Compiling Faust audio DSP code to WebAssembly , 2017 .

[14]  Elliott Wen,et al.  Wasmachine: Bring IoT up to Speed with A WebAssembly OS , 2020, 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops).