Skip to content

Conversation

@psiegl
Copy link
Contributor

@psiegl psiegl commented Oct 6, 2025

This is a work-in-progress state

This code works currently on ArchLinux:
$ yay -S clang lld wasi-libc wasi-compiler-rt libwasmtime iwasm
iwasm PKGBUILD must be patched to not strip the static library. See https://aur.archlinux.org/packages/iwasm

Content:
The given code provides a Proof-Of-Concept, showcasing that a Wasmtime can support ARINC653 APEX interfaces as host functions. The PoC shall also proof, that it could work on Little Endian as well as Big Endian architectures (such as PowerPC still represented in avionics). There are a few caveats why ARINC653 APEX interfaces can't be 100% compliant to the WebAssembly standard, however the main language C (and C++) is supported and Ada should be supportable:

  1. APEX interfaces defined in WIT will not generate the proper APEX standardised function defintion through wit-bindgen. Thus, the APEX interface is exposed as a plain C header, where to-be-Wasm-ised source code can be directly compiled against.
  2. CREATE_PROCESS() and CREATE_ERROR_HANDLER() can't comply to the WebAssembly standard, as they pass a function pointer SYSTEM_ADDRESS_TYPE.
  3. WebAssembly defines that values returned are passed through a host functions return .... Meaning, function parameteres are 'just' input. However, the APEX interfaces all use plain pointers as function parameters to return content.

Again, as long as C, C++, Ada are the main languages, 2 and 3 should be no worry.

Open Topics:

  1. Fix NixOS CI builds (currently this code works on ArchLinux)

Choosing WebAssembly runtime
The compilation will create a bin folder. Change the symlink from p_wasmtime to p_wamr if WAMR shall be employed.

WebAssembly Specification

https://www.w3.org/TR/wasm-core-2/#concepts%E2%91%A0

"Each function takes a sequence of values as parameters and returns a sequence of values as results."

https://www.w3.org/TR/wasm-core-2/#function-instances%E2%91%A0

"A host function is a function expressed outside WebAssembly but passed to a module as an import. The definition and behavior of host functions are outside the scope of this specification."

https://www.w3.org/TR/wasm-core-2/#functions%E2%91%A4

@psiegl psiegl force-pushed the wasm-runtime branch 2 times, most recently from df4fe50 to bf877c4 Compare October 6, 2025 19:32
@psiegl psiegl marked this pull request as draft October 6, 2025 19:38
@psiegl psiegl force-pushed the wasm-runtime branch 14 times, most recently from 50f9627 to 6904674 Compare October 13, 2025 17:19
@psiegl psiegl force-pushed the wasm-runtime branch 4 times, most recently from b306875 to 1cebfe6 Compare October 17, 2025 22:32
@psiegl psiegl force-pushed the wasm-runtime branch 8 times, most recently from 47e396b to f21e9c6 Compare October 24, 2025 17:58
@psiegl psiegl force-pushed the wasm-runtime branch 11 times, most recently from a72504b to 634c38b Compare October 28, 2025 23:11
@psiegl psiegl force-pushed the wasm-runtime branch 2 times, most recently from bbed222 to b3e4ae2 Compare November 7, 2025 21:56
@psiegl psiegl changed the title [WIP] Enable ARINC653 interface of a653lib within a custom Wasmtime CLI [WIP] Enable ARINC653 interface within custom Wasmtime / WAMR CLI Nov 9, 2025
@psiegl psiegl changed the title [WIP] Enable ARINC653 interface within custom Wasmtime / WAMR CLI [WIP] Enable ARINC653 interface within both Wasmtime / WAMR custom CLI Nov 9, 2025
@psiegl psiegl force-pushed the wasm-runtime branch 3 times, most recently from 41d241f to ed50347 Compare November 11, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant