I've got the beginnings of a Swift wrapper for wasmtime using the C API, as suggested by @Alex Crichton the https://github.com/bytecodealliance/wasmtime-py repo has been very helpful in getting this working. The Swift wrapper Package runs on macOS when wasmtime is built for the aarch64-apple-darwin and x86_64-apple-darwin targets, however wasmtime doesn't yet appear to compile to iOS / aarch64-apple-ios. Would there be any interest in patches to get wasmtime building on aarch64-apple-ios, and is there a sense of how involved this task would be and if there would be any major barriers to getting this working?
Patches would definitely be welcome!
The main thing that's probably a blocker is the need to map executable memory at runtime (e.g. a JIT) which IIRC iOS heavily regulates and basically doesn't allow us to do
Precompiling wasm modules and shipping them as part of the app bundle would be allowed, right? It would be much less useful as you can't download new wasm modules at runtime, but at least work in some cases.
Yeah that should work in theory, but that's not quite fully integrated into Wasmtime today and would require some further work postprocessing a *.cwasm
into a linkable object file to go into an application for example.
Alex Crichton said:
Yeah that should work in theory, but that's not quite fully integrated into Wasmtime today and would require some further work postprocessing a
*.cwasm
into a linkable object file to go into an application for example.
Ok thanks for the explanation. It sounds like building wasmtime
on iOS wouldn't be sufficient to be able to publish apps using *.cwasm
, and we would need to fully implement the *.cwasm
postprocessing to make this more broadly useful. For now I'm going to start looking into the build issues for the aarch64-apple-ios
target as a first step. It would be good to understand in more detail what work is needed on the postprocessing front and how much of a lift this would be, and if there is interest from the wasmtime team in getting this integrated.
Sounds good! I'd be happy to try to help sketch something out when things are closer to working
@Alex Crichton I have a draft PR up just to get wasmtime compiling for the iOS target: https://github.com/bytecodealliance/wasmtime/pull/7506. I haven't done any testing of this yet, my goal for this PR was to get the crate compiling as a first step . Please let me know if you have any feedback.
Thanks! I'll take a look
Last updated: Dec 23 2024 at 13:07 UTC