Stream: t-compiler/rust-analyzer

Topic: Wasm plugins


DevinR528 (May 21 2021 at 17:45, on Zulip):

Hey, I'm a Google Summer of Code student working on Ruma's automated checks. My mentor forwarded me matklad's redit comment about a possible utopian future where one could "easily" write plugins for R-A using wasm. If anyone would be interested in expanding on this there might be a chance for some cross pollination?!

Florian Diebold (May 21 2021 at 17:57, on Zulip):

well, the main problem would be exposing all of the APIs one would need to write a check or assist, presumably even in a stable way (we are still evolving the APIs a lot, they are very much not stable)

Florian Diebold (May 21 2021 at 17:57, on Zulip):

the rest (loading some wasm, executing it) is probably comparably trivial

Florian Diebold (May 21 2021 at 17:58, on Zulip):

I don't know how easy current wasm engines make exposing APIs from Rust, admittedly

Jonas Schievink [he/him] (May 21 2021 at 18:01, on Zulip):

one application that would also benefit normal r-a usage would be WASM proc macros, but that seems fairly unrelated to allowing arbitrary assist and diagnostic plugins

DevinR528 (May 21 2021 at 18:11, on Zulip):

When you say "exposing APIs from Rust do you mean this direction? So it would be up to RA to deal with running the wasm?

Will it be helpful for me to occasionally let you know how the tool is coming, giving everyone an idea of what the exports might be? Maybe help with a public API when the RA crates are used outside RA.

Are the WASM proc-macros about sandboxing or is this something specific?

Florian Diebold (May 21 2021 at 18:13, on Zulip):

When you say "exposing APIs from Rust do you mean this direction? So it would be up to RA to deal with running the wasm?

yes

Jonas Schievink [he/him] (May 21 2021 at 18:18, on Zulip):

Are the WASM proc-macros about sandboxing or is this something specific?

I was more thinking about improving reliability – we currently run them in a separate process, and when that crashes we just stop expanding them. With WASM we could retry the execution much easier.

Jonas Schievink [he/him] (May 21 2021 at 18:19, on Zulip):

Sandboxing is also useful of course

Last update: Jul 27 2021 at 22:30UTC