3 ms·
Is anyone doing Clojure to Wasm?
by nerpderp82 4y ago
Is anyone doing Clojure to Wasm?
- Mikeb85 4y agoHow would you do that? Compile a JVM to WASM? A GraalVM to WASM image? Seems like it'd be too heavy for the web.
- pjmlp 4y agoClojure always builds on their host platform, that is why even its reader has conditionals for each platform. A WebAssembly implementation would target the WebAssembly bytecode, and everything beyond the core forms would be based on WebAssembly ecosystem.
- fulafel 4y agoJS is a much better compile target. WebAssembly doesn't have GC and it's just not geared towards dynamic languages. You might attempt the equivalent of a native code compiler for Clojure but just targeting WebAssembly, plus a low level runtime implementing GC and JS interop, but it's a lot of work and there's no guarantee it would be competitive since JS JITs are quite good.
- the-alchemist 4y agoEveryone is waiting for WASM to support garbage-collection (GC) officially. =) Clojure has Javascript, JVM, .NET, LLVM, Arduino, GraalVM, etc. targets, so rest assured, a WASM version will come out as soon as it makes sense!
- pjmlp 4y agoNot everyone, anyone that cares is shipping their own GC implementation just as they have to in regular CPUs. GC is "coming" since WebAssembly was announced.
- nerpderp82 4y agoI'd love a Clojure(Script) that ran on Wasm, even if it bundled its own GC. One path through this would be the Gambit Scheme ClojureScript compiler.