https://clojurians.slack.com/archives/CDF0NV7G8/p1743257942308689
That's nice. I might be missing something but what's the point? Is anything really using web assembly? I've seen it raved about but it doesn't seem it's actually used in practice?
Well for one thing (as I understand it) ClojureScript needs the JVM to compile code. If the Clojure jar compiled to Wasm, Then it could be done in the browser. Or in Python. Or...
I'm not pushing for or against wasm at this point. But I think newer technologies shouldn't be written off because they're not popular yet! 😄
It might be a fun exercise to see how much of clojure you need to eliminate to get it to compile, and if it could possibly be done at all.
from one pov, clojure is just a shell script that runs java on a jar file, right?
and native-image is just a program that converts a jar to some executable form...
maybe worth playing around
Oh ya, I'm totally excited that Clojure might also be able to target WASM. I think maybe I was realizing at the same time that, I've heard so much of WASM, and yet I've still not seen any use-case for it or real use of it.
Right, it's a promising solution looking for real problems
But, the idea that the ClojureScript compiler could then run in the browser is really interesting.... Maybe we could get better REPL experience then.
My current take is that, yes it allows many programs to run in the browser, but the size of their bundle it really large, so in practice, you don't want a website shipping WASM. But maybe I'm wrong.
I've been looking into wasm for past couple weeks, not at the browser runtime, but loading wasm modules is YS (sci).
It's about the same as loading them from any other langauge.
wasmtime has bundles for a bunch of languages.
also I just arrived to kubecon in london, and I think most of the fermyon team will be here. (server side wasm company)
but to your point, there's no existing registry of useful wasm modules or package managers
I'm thinking about starting something up in that regard...
I've only heard of it used for like, I need a bare-metal performance algorithm in my web app, so that part I will write in C++/Rust and compile to WASM, and then use it from JS. But if you try to replace JS with another garbage collected or scripted runtime compiled to WASM, you'll get a huge bundle size, and probably worse performance than JS itself. Since you'll be bundling a whole language runtime in WASM alongside it.
what if clojure libs could be compiled to wasm and used in any language
nod
Hum... ya I have heard of WASM as like a universal VM. But it lacks Garbage Collection no? Which is the main blocker? And then, is it better than JVM? Graal already support Python, Ruby, and so on.
I think wasmgc is fully specced and implemented in places
Yeah it's prolly not gonna beat the JVM out of the gate, right?
But the JVM has a 30 year head start!
The JVM wasn't always good, iirc...
It was basically a wasm. A solution looking for problems
> Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. — Wikipedia (TIL)
More on point... > At the start of the Java platform's lifetime, the JVM was marketed as a web technology for creating https://en.wikipedia.org/wiki/Rich_web_application.
@didibus thanks for helping me stay awake until the time I wanted to fight this jetlag.
night night
GN