Fork me on GitHub
#off-topic
<
2017-05-17
>
akiroz04:05:57

Huh, I thought wasm was just some binary format of JS. I guess it won't be a compile target for Clojure then

nikki08:05:27

@U1WMJ5CQ2 :thinking_face: it's not "some binary format of JS" but the latter is still possible (you need to think abt mem mgmt explicitly tho)

akiroz08:05:21

While it's possible, I really don't think it's worth the trouble of implementing a new Clojure runtime when CLJS works perfectly fine.

nickbauman16:05:25

At some point someone will make an LLVM target for Clojure.

reitzensteinm09:05:15

If you could somehow hook in to the V8 GC, it could work... if you have to do GC yourself, it's very very unlikely to beat the performance of cljs

reitzensteinm09:05:19

Clojure generates a ton of garbage

reitzensteinm09:05:51

And it's very hard to do static analysis for things like escape analysis to cut down on it

akiroz15:05:03

yeah, I think Clojure just isn't designed to be hosted on a low-level runtime like wasm easily. That said, I've seen native Clojure runtime implementations before like ferret-lang that supports a subset of Clojure. http://ferret-lang.org/

akiroz15:05:15

But I'm not so sure about the performance of Ferret -> C++ -> WASM VS Clojure -> JS

reitzensteinm11:05:54

I have no numbers to back it up, but I feel like the overhead of stop the world non generational boehm for many programs would exceed the computation + GC in cljs on v8

reitzensteinm11:05:23

let alone the overhead of the computations themselves

reitzensteinm11:05:27

which is to say, don't do that for performance. I'd be surprised if any program you ever wrote or library you ever used ran faster on that toolchain

reitzensteinm11:05:59

I use unity compiled to wasm via IL2CPP, and it's OK, but still an order of magnitude slower than native

reitzensteinm11:05:14

a lot better than IL2CPP->emscripten JS though

nikki08:05:03

DOM is fine just implement a UI in WebGL and shaders (or just direct SPIR-V target for shader dsls)

nikki08:05:41

but yea first you want a resource mgmt dsl to impl the other dsls in and have them do economics with each other (GC is actually just about currency... lol)

nikki08:05:31

i think a value-ish thing for immutables and then add rust-like affine types could be good, and you can bind WebGL object ownership into that

nikki08:05:40

(Not necessarily thinking of a clj-implementing lisp here, just some lisp...)