mtshiba / pylyzer

A fast static code analyzer & language server for Python
http://mtshiba.github.io/pylyzer/
MIT License
2.35k stars 33 forks source link

Compiling and targetting to WASM? #100

Open jymchng opened 3 weeks ago

jymchng commented 3 weeks ago

Thank you for your great work!

I have a simple Python playground which I am intending to add a [Check] button for type checking or even language server if I figure out how to run a WebSocket with a Web Worker and WASM.

I am just curious since Ruff has successfully targetted WASM, is this in your plans as well?

mtshiba commented 3 weeks ago

Under crates, there is a crate called pylyzer_wasm. If you compile this with wasm-pack, you can use the basic features of pylyzer. In this case, it is needed to connect the analyzer and the editor manually. When I created a playground for the Erg language in the past, I used this method.

I have no experience with using a language server in-browser, but the following may be helpful.

jymchng commented 3 weeks ago

Under crates, there is a crate called pylyzer_wasm. If you compile this with wasm-pack, you can use the basic features of pylyzer. In this case, it is needed to connect the analyzer and the editor manually. When I created a playground for the Erg language in the past, I used this method.

I have no experience with using a language server in-browser, but the following may be helpful.

Thank you for sharing, let me study these examples more closely.