Commit Graph

4 Commits

Author SHA1 Message Date
Crypt Keeper
a91140f7f7 Changes RuntimeConfig to an interface and exposes WithWasmCore2 (#518)
WebAssembly Core Working Draft 1 recently came out. Before that, we had
a toe-hold feature bucked called FinishedFeatures. This replaces
`RuntimeConfig.WithFinishedFeatures` with `RuntimeConfig.WithWasmCore2`.
This also adds `WithWasmCore1` for those who want to lock into 1.0
features as opposed to relying on defaults.

This also fixes some design debt where we hadn't finished migrating
public types that require constructor functions (NewXxx) to interfaces.
By using interfaces, we prevent people from accidentally initializing
key configuration directly (via &Xxx), causing nil field refs. This also
helps prevent confusion about how to use the type (ex pointer or not) as
there's only one way (as an interface).

See https://github.com/tetratelabs/wazero/issues/516

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-05-02 10:29:38 +08:00
Takeshi Yoneda
82aec51eb9 Adds tests for multiple goroutines (#331)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2022-03-04 18:19:26 +09:00
Crypt Keeper
56135d4125 Sets floor go version to 1.17 (#317)
We temporarily supported go 1.16 to allow migration. By setting the
floor to 1.17, we can improve performance and focus on only two versions
(1.17 and soon 1.18).

See https://go.googlesource.com/proposal/+/refs/changes/78/248178/1/design/40724-register-calling.md
See #37

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-03-03 10:48:21 +08:00
Adrian Cole
76c0bfc33f Combines Store+Engine into Runtime
This simplifies state management and the amount of terminology end-users
need to learn by using one concept `Runtime` instead of two: `Engine`
and `Store`. This bridges the concepts to the specification by still
having `wazero.Runtime` implement `wasm.Store`.

The net result is that we can know for sure which "engine" is used when
decoding. This allows us a lot of flexibility especially pre-compilation
when JIT is possible.

This also changes the default to JIT based on compiler flags so that
downstream projects like wapc-go don't have to do this individually
(including tracking of which OS+Arch have JIT).

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-03-02 12:29:13 +08:00