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

[FLI-1159] Experiment: Go + WASM #327

Closed
5 tasks
markphelps opened this issue Aug 9, 2024 · 0 comments
Closed
5 tasks

[FLI-1159] Experiment: Go + WASM #327

markphelps opened this issue Aug 9, 2024 · 0 comments
Milestone

Comments

@markphelps
Copy link
Contributor

markphelps commented Aug 9, 2024

There have been several issues with using FFI to call from host languages into the FFI engine.

See:

Ex:

we were afraid to include the ffi utility in the legacy php project.

We've been thinking about this recently, particularly because FFI can be a bit daunting and doesn't work in all environments.

One approach we are actively investigating is leaning further into WASM for the evaluation logic. Then using WASM runtimes in each of the languages that support it (Go is one) to call the evaluation functions.

Currently though, because WASM / WASI spec is not complete, and definitely not supported everywhere, we will have still perform the HTTP requests in the native language like we do in flipt-client-browser and then pass the data to the wasm engine as JSON.

I think we could leverage some of what was done in #326 (Go) to fetch the state like we do in flipt-client-browser but instead of re-implementing the evaluation logic in pure Go we could call into our WASM engine (after adding WASM runtime in Go also).

This would make the Go SDK cross-platform and we could then expand to other languages as well.

This issue tracks the progress/TODOs for trying this in Go first as we know Go the best internally.

TODO

  • Refactor evaluation lib to remove any HTTP bits (maybe continue on with main...rust)
  • Build a native WASM engine (no wasmbindgen as it only works for JS)
  • Create a version of the Go SDK that pulls in a WASM runtime to call into the wasm eval function
  • Do all HTTP calls in the Go SDK
  • Test, Package, Ship

From SyncLinear.com | FLI-1159

@markphelps markphelps changed the title Experiment: Go + WASM [FLI-1159] Experiment: Go + WASM Aug 9, 2024
@markphelps markphelps added this to the v.54 milestone Oct 16, 2024
@github-project-automation github-project-automation bot moved this to Done in Roadmap Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant