sunfishcode commented on Issue #1560:
wasmtime-environ is meant to be usable both for JIT and AOT use cases; can you discuss how AOT use cases fit within this refactoring?
alexcrichton commented on Issue #1560:
Oh sure yeah! So right now I imagine that if you're building an AOT backend then our current organization is probably not what you want. In theory you'd have to separate components, one for compilation and one for consumption of the compiled artifacts. The compiler would depend on cranelift at some point but the execution component would depend on
wasmtime-runtime
and doesn't want cranelift as a dependency. I'm hoping to refactor wasmtime internally to enable this use case.The general idea is that you should be able to statically split the wasmtime world where the runtime half doesn't depend on the compiler half. Currently the "runtime half" is the
wasmtime-runtime
crate which depends onwasmtime-environ
(for shared data structures), butwasmtime-environ
unconditionally depends on codegen backends, making it unsuitable for this purpose.I don't mean to conflate JIT/codegen/etc, and if you'd prefer I can extract all the codegen bits to something like a
wasmtime-codegen
crate or something like that.
sunfishcode commented on Issue #1560:
Yeah, splitting pieces of wasmtime-environ into separate crates sounds good to me. The "environ" in the name is meant to relate to the
FuncEnvironment
andModuleEnvironment
trait implementations that it contains, so if those move to a different crate,wasmtime-environ
could benefit from a new name.
alexcrichton commented on Issue #1560:
I'm mostly just assuming the original intention for these crates, so I'm likely also misinterpreting things. Today though I think we still need to change something (
wasmtime-runtime
shouldn't transitively depend on cranelift/lightbeam). It sounds like you'd like to keep the code inwasmtime-environ
separate fromwasmtime-jit
, so we'll need to splitwasmtime-environ
. Thewasmtime-runtime
crate would depend on the new crate that doesn't depend on cranelift.Does that sound right? Would you prefer that
wasmtime-environ
keep its name and a new crate is split out likewasmtime-types
orwasmtime-core
or something like that?
alexcrichton commented on Issue #1560:
I think I'll try to tackle this later.
Last updated: Nov 22 2024 at 16:03 UTC