5 ms·
Can we start getting frameworks in other languages that compile to WebAssembly instead. We already have enough JS frameworks
by faraaz98 6y ago
Can we start getting frameworks in other languages that compile to WebAssembly instead. We already have enough JS frameworks
- eingaeKaiy8ujie 6y agoRust compiles to WebAssembly and has a few web frameworks already. Many other languages also have web frameworks and compile to JS. Today it is possible to do web development and avoid JS entirely.
- MH15 6y agoCodebases compiled to WebAssembly still cannot access the DOM directly. So yes, for now you still need JavaScript. https://developer.mozilla.org/en-US/docs/WebAssembly/Concepts#porting_from_cc https://developer.mozilla.org/en-US/docs/WebAssembly/Concept...
- eingaeKaiy8ujie 6y agoYes, but languages/frameworks can provide their own abstractions to access the DOM and web platform so that you can avoid writing any JavaScript yourself, for example `web_sys` in Rust.
- SCLeo 6y agoI have tried writing websites with rust instead of JavaScript. Unfortunately, the tooling is just not there. More specifically, I am talking about wasm-bindgen, which provides two-way bindings. The problem with it is that since all the declarations are generated with build.rs, there is no autocompletion. Since I am spoiled by modern tooling, no autocompletion to me means not feasible pass demo stage. (https://github.com/rust-lang/rls/issues/1489 https://github.com/rust-lang/rls/issues/1489) Aside from the lack of autocompletion, passing rust closures to js land (DOM) is extremely janky as well. However, that might be caused by my lack of experience with rust. (If you are curious, this is what I made: https://github.com/SCLeoX/non-grid-path-finder https://github.com/SCLeoX/non-grid-path-finder)