wetware / pkg

Peer-to-peer cloud environment
https://wetware.run
Other
38 stars 7 forks source link

Use the Wazero interpreter in architectures that don't support the compiler #163

Closed mikelsr closed 11 months ago

mikelsr commented 11 months ago

Source: https://github.com/tetratelabs/wazero#conformance

lthibault commented 11 months ago

Good idea. I see two approches (but might be overlooking others):

  1. Add a flag and corresponding environment variable that instructs Wetware to use the WASM interpreter
  2. Use Go build constraints to instruct the compiler which source file to use for the Wazero options based on architecture

Option 1 has the advantage of being simple, but the disadvantage of requiring the configuration to be explicitly set. This might confuse beginners. Option 2 is a bit more verbose, but has the advantage of being transparent to the user. I think I prefer 2, personally.

lthibault commented 11 months ago

NVM, I saw this before #164. I like your approach better! 👍