Hacker News new | ask | show | jobs
by thesmart 119 days ago
WebAssembly is amazing, but I don't think making it a DOM controller is where the action is. What specific scenarios do you aspire to unlock and why would those scenarios lead to broader adoption?
5 comments

Web development in languages other than Javascript, mostly. Today this would benefit languages like Rust that already have adhoc JS-based glue layers to enable their WASM output to call Web APIs, but you can imagine a future where languages like TypeScript compile directly to WASM instead of transpiling to JS...
> I don't think making it a DOM controller is where the action is

Why not? I feel like people have gotten so used to the limitations of WebAssembly today that they've internalized JS as the only answer. But I don't really like JS, and would love to build web apps in other languages, and I totally would if it wasn't a huge pain (and slower too!)

Being able to program modern websites without having to learn javascript/typescript in any way? :)
> What specific scenarios do you aspire to unlock

Modern languages come with lots of interesting features like better dev ex, null safety, etc. Js is a fine language, but there are other languages that bring unique advantages, the web shouldn't block developers from using better tools. The web is best off when developers have freedom.

I think it's less about unlocking new scenarios per se, and more about making existing scenarios better. If given the choice I'll generally prefer to write my code in Rust. But with native Wasm Component-based DOM bindings that same code will now run twice as fast.
The other side of the story here is also worth considering: native support in browsers provides a stable compile target for language toolchains. It'd be really nice if targeting the web from e.g. Kotlin, Swift, or Rust becomes just a matter of passing the right flag to the compiler.