write envoy filter using wasm langu

123 views
Skip to first unread message

Jenny M

unread,
Jun 27, 2021, 4:15:28 AM6/27/21
to envoy-users
Hey,

we need to create an envoy filter using wasm (not lua), there is few language that supporting it.

  • assamblyscript
  • tiny-go
  • rust
  • c++

we need to do some auth processing/header modification, serialisations / deserialisations etc, my question is which language has the most supporting libs for wasm ?

the reason that Im asking that is that I start with tiny-go and found that many feature/libs of go is missing which make the dev very difficult...

thanks!

Zizon Qiu

unread,
Jun 27, 2021, 9:40:18 AM6/27/21
to Jenny M, envoy-users
Nowadays, it is pretty straightforward to interoperate through the Envoy WASM system,
just export and import whatever you need in your preferred WASM language.

see: 

prefix ABI functions with proxy_ will just work out.

e.g.
to use send_local_response, just declare an import function named proxy_send_local_response.
the Envoy WASM system will do the left binding for you.

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/d8316690-6f41-4581-aeec-21fd68b5b263n%40googlegroups.com.

Jenny M

unread,
Jun 27, 2021, 4:00:26 PM6/27/21
to envoy-users
ok thanks.
In case I need to create filter which needs to run 500,000,000 calls a day and maybe more, which language I should use (from performance aspect) , it there any difference 
if i use wasm with rust /  assembly script / cpp?

Michael P.

unread,
Jun 27, 2021, 8:20:44 PM6/27/21
to envoy-users
Zig has excellent support for WASM. Zig is a newish language and not yet at version 1 so subject to some change between releases. Zig is looking very promising, particularly for the WebAssembly space.

Takeshi Yoneda has written a very helpful SDK with working examples at https://github.com/mathetake/proxy-wasm-zig-sdk and https://twitter.com/mathetake/status/1397896266827198469

Zizon Qiu

unread,
Jun 27, 2021, 9:56:09 PM6/27/21
to Jenny M, envoy-users
It should be little matter on which upper language to use but the WASM runtime you chose(v8/wamr/wasmtime/wavm).

Jenny M

unread,
Jun 28, 2021, 12:26:07 AM6/28/21
to envoy-users
Thanks! in case I write the wasm in tiny-go could I choose any runtime? how should I decide which runtime to use? 

Zizon Qiu

unread,
Jun 28, 2021, 12:44:37 AM6/28/21
to Jenny M, envoy-users
Reply all
Reply to author
Forward
0 new messages