Closed mhmd-azeez closed 11 months ago
Great work! I'm curious what the lift would be pre 1.0 to actually change the SDK API to make it so we don't actually expose any wazero functions or package info -- instead we add some configuration functions to our API that set thing in wazero.
Just as we don't expose anything wasmtime related in the Rust SDK.. if it's a massive change that would also be good to know.
@nilslice Currently we are exposing these wazero APIs:
RuntimeConfig
WithCoreFeatures
: ❌WithMemoryLimitPages
: ✅WithMemoryCapacityFromMax
: ❌WithDebugInfoEnabled
: ❌WithCompilationCache
: ❌WithCustomSections
: ❌WithCloseOnContextDone
: ❓ (If timeout is configured, this will automatically be enabled)ModuleConfig
WithArgs
: ❌WithEnv
: ❌WithFS
: ✅WithFSConfig
: ✅ (wazero allows readonly mounting too)WithName
: ✅WithStartFunctions
✅ (we have our own module initialization logic)WithStderr
: ❌WithStdin
: ❌WithStdout
: ❌WithWalltime
: ❌WithSysWalltime
: ❌WithNanotime
: ❌WithSysNanotime
: ❌WithNanosleep
: ❌WithOsyield
: ❌WithSysNanosleep
: ❌WithRandSource
: ❌api.ValueType
api.EncodeXX/api.DecodeXX
api.Memory
It all comes down to how many of these we want to implement for 1.0, maybe we can start with a minimal number of these implemented and then add them as people ask for them.
I think I can squeeze these in before December 4th:
RuntimeConfig
struct: configure cachingModuleConfig
struct: configure WithStderr
, WithStdin
, WithSysWalltime
, and WithStdout
api.ValueType
enumOur own api.EncodeXX/api.DecodeXX
functions
Let me know if there is anything else you think is important
This PR is related to https://github.com/extism/extism/pull/605
Without using compilation cache: 3ms with compilation cache: 0.5ms
Since we're already exposing
wazero.RuntimeConfig
, I think we just need to mention it in the README