4 ms·
JS devs - do everything but write in another language challenge level: Impossible.
by Jcampuzano2 2y ago
JS devs - do everything but write in another language challenge level: Impossible.
- bastawhiz 2y agoCall me when browsers support another language. What are we going to use? CSS?
- modeless 2y agowasm "but wasm has to call JavaScript to use browser APIs" WasmGC is shipped in Chrome and Firefox and enabled by default in WebKit nightly
- johnfn 2y agoLet me know when WASM has a dev workflow that gets a change to your browser 1/10th as fast as Vite + TypeScript + React.
- modeless 2y agoThe web is undefeated in iteration time for sure. There are some native workflows that approach it with hot code reloading, but I'm not aware of anyone doing that for wasm yet.
- xpe 2y agoI will grant that fast iteration is beneficial. But for me, under 10 seconds is usually fast enough. (For example, I don't think I would care too much when comparing 0.5 vs 5 second builds.) I personally care a lot more about having a confidence-inspiring language and ecosystem. In my experience with Rust and WASM (with various tools such as Dioxus), I find myself caring a lot more about the WASM ecosystem and browser evolution/improvement. For example, at bottom, the JS interop feels pretty sub-optimal. Calling this "hcky" might even be deserved: I'm talking about memory serialization between JS-land and WASM-land. As I understand it, we may see significant improvement under the hood in the next few years. (I'm not an expert on the particular proposals, their adoption, etc. Please weigh in if you have a better sense.)
- johnfn 2y agoThe reason I bring it up is because web-dev often ends up being an extremely long sequence of small tweaks. "Hmm, did that make the modal go on top of the sidebar? [save] no? [save] did that? [save] how about that? [savesavesavesavesavesave]" Iterate that process 1000 times and you have my typical workflow. This is why even a 10 second build time, which is pretty fast for most domains, is actually pretty mind-numbing in web-dev. I'm all for having a confidence-inspiring language and ecosystem, don't get me wrong, but it's kind of a non-starter if I can't build at the same pace in Rust as I can in typical web technologies.
- nuz 2y agoWasmGC is just garbage collection? Not browser APIs
- modeless 2y agoMy understanding is that GC integration was the major blocker for better wasm/browser API integration. Now that it is here I bet better integration is not far behind, although I haven't personally investigated the current proposals.
- postalrat 2y agoWASM has to call javascript to do really anything.
- bastawhiz 2y agoGreat, show us how you render something on the page with wasm only
- slashdave 2y agoWell... sort of? https://emscripten.org https://emscripten.org
- Arch485 2y agoOh yeah. CSS is turing complete, after all!
- hyperhello 2y agoLots of programmers only really feel comfortable in C++ because it's the language they were trained in.
- lovethevoid 2y agoGot it. Writing in Typescript.
- pier25 2y agoThere's a lot of that, certainly, but there are legitimate reason to use JS/TS. Frontend is an obvious one but also using services like CF Workers or Deno Deploy which are optimized for V8. You're going to get better uptime and lower latency than anything else at that cost.
- awesomeMilou 2y agoSerious question, when would you want to use synchronization primitives in the frontend? I've seen the discussion revolve around service worker / web worker usage, but I think sharing ressources between a worker and the main thread has been discussed in the past and has ultimately been abandoned for security reasons.
- pier25 2y agowhat do you mean with "synchronization primitives"? do you mean like reactive data?
- baxuz 2y agoWhat a bad take. If you're writing code that runs in a browser, there's no other choice. I'm not counting things like ClojureScript, as you still need to have deep knowledge of the low-level primitives, which exclusively bind to JS. You can use other languages that compile to WebAssembly, but it's borderline as it's basically just a VM / self-contained executable that you can pipe to. It's completely isolated from the browser.