wabt icon indicating copy to clipboard operation
wabt copied to clipboard

wasm-interp: Add multi-module support

Open tDwtp opened this issue 3 years ago • 7 comments

#2005 feature is finally implemented. Modules can be loaded via -m --module=NAME:PATH Maybe I will expand it in the future to accept dll/so/dylib/bundle as well. I am open for suggestions. -N --native=mod:lib.so would be nice, or make --module more dynamic? * '@' will override the module name '$' is reserved to prefer prefer the debug name if provided in the name section. providing no NAME use the file-name. again reserved for the future is to use the debug name given in the name section

* note that native libraries either need some witx glue, or ffi or an API to bind against.

tDwtp avatar Sep 28 '22 21:09 tDwtp

How can I write a test, to check for it to work porperly. I found how to run app.wasm, but how can I provide a second file?

tDwtp avatar Sep 29 '22 14:09 tDwtp

wasi is working now. and i change unordered_map and the file fallback.

I really tried to make the arguments work, but I would need another argument to AddArgument.

parser.AddArgument("arg-name", OptionParser, [callback], std::string stopper);

I could also just add it to OneOrMore and ZeroOrMore and generally assume its . as i assumed for my case. It cannot be -- as this is handled by the parser itself! It does not seem worth the hassle. I am not fluent enough in all shells to attempt it. I'd pick between +, . or , but I really dont know. I picked . in my hack because it seemed most sensible.

tDwtp avatar Oct 01 '22 17:10 tDwtp

What do you think about renaming this PR to "wasm-interp: Add multi-module support"?

sbc100 avatar Oct 01 '22 17:10 sbc100

wasi is working now. and i change unordered_map and the file fallback.

I really tried to make the arguments work, but I would need another argument to AddArgument.

parser.AddArgument("arg-name", OptionParser, [callback], std::string stopper);

I could also just add it to OneOrMore and ZeroOrMore and generally assume its . as i assumed for my case. It cannot be -- as this is handled by the parser itself! It does not seem worth the hassle. I am not fluent enough in all shells to attempt it. I'd pick between +, . or , but I really dont know. I picked . in my hack because it seemed most sensible.

Awesome, I don't think we need to worry about getting the option separator thing in as part of this change.

sbc100 avatar Oct 01 '22 17:10 sbc100

Don't have much time for today,

We can bikeshed the name of the argument as a followup. I would like to remove the magic @ syntax though, since that seems unnecessary for v1.

Will revert the hack later.

I think the main thing we need to do before landing this is figure out a way to start testing this.

I have a simple test ready. will add 4 more simple ones at least. Already have them in mind. I convert a wat file to wasm and use it for module imports. I just don't know where to put them and how the testing works exactly.

CU tomorrow.

tDwtp avatar Oct 01 '22 17:10 tDwtp

I... do not remember how I had planned the tests... I need help again.

tDwtp avatar Oct 14 '22 16:10 tDwtp

sorry for the many mails... I am still setting stuff up, I moved and did not have my pc set up untill now. I still have not set up my dev enironment properly...

tDwtp avatar Oct 14 '22 23:10 tDwtp