Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Support Android/iOS #40

Open
jlalvarez18 opened this issue Aug 31, 2021 · 3 comments
Open

Support Android/iOS #40

jlalvarez18 opened this issue Aug 31, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@jlalvarez18
Copy link

jlalvarez18 commented Aug 31, 2021

I am having an issue with the WasmModule loading. I have the following in my Flutter app:

  final data = await rootBundle.load('assets/add.wasm');

  final mod = WasmModule(data.buffer.asUint8List());

  print(mod.describe());

  final inst = mod.builder().build();
  final add = inst.lookupFunction('add_one');

  print(add(12));

I have run dart run wasm:setup. The issue I find is Directory.current.uri returns \ which is obviously incorrect. In particular, I am talking about _getLibPath() where locating the library fails.

Is this not designed to work with Flutter applications? Mobile in particular.

@liamappelbe
Copy link
Contributor

We haven't ported the package to mobile platforms yet, but we definitely plan to. I'm hoping to start working on this in a few weeks, once I finish my current project.

@jlalvarez18
Copy link
Author

@liamappelbe cool. If there is any way I can contribute, let me know.

@modulovalue
Copy link
Contributor

iOS forbids JIT compilation. According to wasmer, wasm files will have to be precompiled to dylibs when running on iOS devices. Therefore, I think we won't be able to just offer a single top level function for all platforms and we will need more like a configuration that takes a path to a wasm binary and a dylib once we actually support iOS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants