Potentially crazy idea, one that probably only works in a very niche context: use the Electric compiler to identify the boundaries between CLJ and CLJS code, but instead, compile the CLJ parts to wasm with Graal and run everything in the browser.
That would only work if you’re fine with having access to literally no APIs, including mounting DOM elements.
Oh, and no websocket
WASM works best for number crunchy things since you pay for serde every time you need to access browser APIs, and even then it should be pretty crunchy
in theory server/client can be any of js and jvm, so e.g. the server jvm but client also jvm (a reactive swing or javafx client). Server could compile to js and run as a web worker. In practice we'd need a client requesting any of this to build it
i think wasm target for cljs is strategically valuable long term, it is the scripting language of the cloud (due to the security model)
but i don't think cljs core team is interested
once cljs supports it, presumably electric can support it fairly easily from there
i do not think wasm is niche, it is also the obvious target for durable execution platforms such as golem.cloud (john degoes's new project, he's the guy who made the Zio effect system which is the current state of art for building resilient microservices at scale used at aws search, disney streaming)
and electric is a perfect fit for durable execution
As a VM it’s one thing, but in the browser, I think it still needs to mature. I read a HN post about a year ago or so about a company that tried to make business of translating JS apps to WASM. It turned out to not be viable, because they could eke out maybe a 5% performance gain for an average app, but with significantly higher maintenance overhead. Things might have matured since then. That said, for things like Automerge, WASM has worked out well.
The dream of WebAssembly in the browser IMO is to have a “native” compilation target for all languages, but right now JS still enjoys special privileges, and will remain so until WASM matures and there’s enough adoption of that mature version.