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

Idea/Discussion: Replace JEXL with WASM #2021

Open
winged opened this issue Jun 19, 2023 · 0 comments
Open

Idea/Discussion: Replace JEXL with WASM #2021

winged opened this issue Jun 19, 2023 · 0 comments

Comments

@winged
Copy link
Contributor

winged commented Jun 19, 2023

While thinking about #2013, I figured that maybe we should look around for a replacement of JEXL. It feels like we're pretty much the only users, and sometimes it feels like it's not really a perfect fit for us.

Problems with JEXL:

  • Implementation differences between JS/Python
  • Type safety ("foo"|answer depends on the question type)
  • Debuggability is rather limited
  • Performance (at least in the backend impl)

As a replacement, I could think of using WASM instead, which is strictly defined and has runtimes for any place we need to run JEXL. This would allow us to share the full implementation between backend and frontend, with only the building-up of the input data structures being JS/Python specific.

A simple transpiler from JEXL or a JEXL-like language to any of the WASM formats would be required, but shouldn't be too hard I imagine - we could even steal the parsers/AST generator from existing implementations.

And maybe one of the WASM text representations would be good enough for "user interaction" in the form builder as well..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant