-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Version 0.0.8
I tried to make a global so I can access it from the module but it appears the initializer of GlobalInstance is inaccessible. It might be because it's not marked as public and since it has a internal(set) member it's deduced to be internal. On a side-note, for this I needed to import both WasmParser and WasmTypes which I think it's a bit excessive.
let runtime = Runtime(hostModules: [ "env": HostModule(globals: [
"myvalue": GlobalInstance(
globalType: GlobalType(mutability: .constant, valueType: .f32),
initialValue: Value.fromFloat32(5.5)
)
]) ])
EDIT 1 - Circular Logic - version based on: 4aff9cc
Everything is completely different in the actual code, in fact, it's still impossible to make a global because circular logic: Global needs to be initialized with Store which you can only get by first making a Runtime which asks for your HostModules in which you need to put your Globals. In other words, it's an infinite loop of dependecies.
Please help, I just need to import a global variable in my webassembly module 😭