Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run payload formatters via WebAssembly runtime #2707

Open
rvolosatovs opened this issue Jun 10, 2020 · 1 comment
Open

Run payload formatters via WebAssembly runtime #2707

rvolosatovs opened this issue Jun 10, 2020 · 1 comment
Labels
c/application server This is related to the Application Server performance Something is slow or takes too much CPU/Memory/...

Comments

@rvolosatovs
Copy link
Contributor

Summary

Support running payload formatters via WebAssembly runtime

Why do we need this?

  • Relying on a well-maintained and audited technology, which will keep improving into the future
  • Proper sandboxing and security guarantees
  • Performance - we should profile this, but I believe this would require less resources and less memory on the AS -> higher throughput at scale
  • Allowing users to write payload formatters in a language of their choice (which compiles to WASM) - e.g. Rust, Go, TypeScript to name just a few, there are many

What is already there? What do you see now?

  • Dependency on a JavaScript VM with unclear maintenance status (last commit was made over half-a-year ago at the time of writing - not a good sign)
  • Only JavaScript supported as payload formatter language

What is missing? What do you want to see?

Embedded WASM runtime, which would run WASM modules.

How do you propose to implement this?

Unfortunately, it is not possible to compile JavaScript down to WASM at this point of time. We would need to both have a JavaScript VM and WASM runtime working alongside for this.
Long term, however, given the simplicity of the formatters, we could parse them and convert to TypeScript, which can, in turn, be compiled to WASM.

At the time of writing there are 2 well-supported runtimes with Go bindings: https://github.com/bytecodealliance/wasmtime-go (wasmtime)
https://github.com/wasmerio/go-ext-wasm (wasmer)

As well as less-mature pure-Go runtimes:
https://github.com/perlin-network/life
https://github.com/mathetake/gasm

Perhaps at a later point of time it will be possible to completely get rid of JS VM and compile JS down to WASM and run it in a WASM runtime.

How do you propose to test this?

Integration testing, existing unit tests

Can you do this yourself and submit a Pull Request?

yes

@rvolosatovs rvolosatovs added performance Something is slow or takes too much CPU/Memory/... c/application server This is related to the Application Server labels Jun 10, 2020
@rvolosatovs rvolosatovs added this to the Backlog milestone Jun 10, 2020
@rvolosatovs rvolosatovs self-assigned this Jun 10, 2020
@rvolosatovs
Copy link
Contributor Author

Regarding JS: WebAssembly/design#219

@htdvisser htdvisser added the needs/triage We still need to triage this label Jun 3, 2021
@htdvisser htdvisser removed this from the Backlog milestone Jun 8, 2021
@nejraselimovic nejraselimovic removed the needs/triage We still need to triage this label Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/application server This is related to the Application Server performance Something is slow or takes too much CPU/Memory/...
Projects
None yet
Development

No branches or pull requests

3 participants