dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.38k stars 192 forks source link

[NativeAOT-LLVM][Question] import wasm modules #2457

Closed sajjadarashhh closed 8 months ago

sajjadarashhh commented 8 months ago

We can import wasm modules? If we cant thats good to implement that in this repo?

SingleAccretion commented 8 months ago

WASM modules themselves cannot be imported, but if you mean WASM methods, they can be imported with WasmImportLinkage (see #2454, #2444, #dotnet/runtime/93824).

sajjadarashhh commented 8 months ago

@SingleAccretion i told above about a component model in wasm

SingleAccretion commented 8 months ago

I see, so it's about producing components as opposed to core WASM modules? The approach so far has been to produce core WASM modules and then use external tools to turn them into components, I believe. It may make sense to support producing components directly, but I am not sure. What does the current tooling story here look like?

yowl commented 8 months ago

We are doing the production of wasm components over in https://github.com/bytecodealliance/wit-bindgen where we are doing the codegen (c#) for NativeAOT-LLVM and Mono interpreter.

yowl commented 8 months ago

use external tools to turn them into components

This is correct, we use wasm-tools for the actual conversion of core wasm modules to components.

sajjadarashhh commented 8 months ago

Its about using components written in another language like rust or js and compiled as wasm component

yowl commented 8 months ago

That scenario would be covered by the wit-bindgen work. You combine the the c# and other language component with wasm-tools compose <c# wasm> <other language wasm> ...

sajjadarashhh commented 8 months ago

That would be nice. Thank you for response