wasi on 9front

the web assembly system interface allows many command-line utilities to run anywhere, including plan 9! it's like java but simpler, at the cost of not supporting some stuff like networking.

table of contents

runtime

wazero is a zero dependency wasi runtime written in go, it mostly works in 9front

pre-compiled blobs

python3

brettcannon has a build of python 3.12.2. running files works, however time.sleep() errors out due to wazero missing this functionality, and there appears to be some platform-specific bug with the repl that causes it to hang on plan 9.

vulpine is eepy says
ugh, isn't the whole point of wasm to not have platform-specific bugs!?
; hget https://github.com/brettcannon/cpython-wasi-build/releases/download/v3.12.2/python-3.12.2-wasi_sdk-20.zip | unzip -s
; mkdir src
; echo 'print("hewwo")' > src/test.py
; wazero run -mount lib -mount src python.wasm src/test.py
hewwo

php-cgi

vmware-labs' webassembly-language-runtimes has a build of php 8.2.6 in addition to python and ruby.

hi says
it's a bit out of date though, the latest build in their releases is from [2023-12-11 Mon]. since [2024-05-31 Fri] they're seemingly in the process of migrating the repository to some other organization, who still has not touched it as of [2024-09-15 Sun]

the wasmedge variants seem to not be supported by wazero, looks like we're stuck with php-cgi.

; hget https://github.com/vmware-labs/webassembly-language-runtimes/releases/download/php%2F8.2.6%2B20230714-11be424/php-cgi-8.2.6.wasm > php-cgi.wasm
; echo '<?php echo "hewwo";' | wazero run php-cgi.wasm
X-Powered-By: PHP/8.2.6
Content-type: text/html; charset=UTF-8

hewwo