3 ms·
There is also a push towards Rust on the web side of things too, it would be amazing to have a single language that could be used for both worlds
by ActionHank 3y ago
There is also a push towards Rust on the web side of things too, it would be amazing to have a single language that could be used for both worlds
- it 3y agoKotlin does this.
- gavinray 3y agoAs does Scala, Clojure, and C#.
- flohofwoe 3y agoThat's already reality though, technically any language with WebAssembly support can be used in "both worlds". In reality of course it's a bit more than just compiler support, you'd want easy interop with Javascript and Web APIs and a working debugger. With the Emscripten SDK and Chrome's and VSCode's WASM DWARF support it's looking pretty good now at least for C and C++ (but I assume the WASM DWARF debugging stuff also works for Rust, since it's the same compiler infrastructure underneath).
- zamalek 3y agoI have really tried using Rust for the web (because I truly enjoy Rust). The ergonomics just aren't there yet. Leptos, as a popular recent example, suffers from one major issue (that most others suffer from too): the JSX stuff is opaque to Rust Analyzer. Code completion aside, you lose the ability to hover - massively crippling any hope of tracking down how to resolve a type mismatch. Web Rust also has the impedance mismatch that Rust has for UI. There are several success stories - e.g. Cosmic Desktop, but I'm certain that there's more love than practicality involved. I think part of the reason is that we are trying to shove in existing patterns - which originate from OOP languages - into Rust. In both semantic and ergonomic terms I have been bitten by trying to OOP in Rust when I was first learning it. I think that there exists an (as yet unknown) solution to the UI problem. It's just going to look nothing like React (or Elm even).