Finally, Java arrives to our browsers! Maybe we could use it to write some small applications with it, let's call them "applets".
WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
61–70 of 88 posts
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#62Interesting - they essentially ship a GC inside the Wasm runtime that replaces what the language VM - be it the JVM, the .NET CLR, Go's GC would supply. But that raises the question - wouldn't it imply that this GC needs to support every special feature of every language (interior pointers, pinning, value types etc.), and have access to the stack layout to have a chance of working? Sounds like a hairy problem to me.…
WASM still grants access to a PL to simply decide to allocate a byte and manage it itself. interior pointers and value types seem like they could be handled by reference counting + native memory allocation. Much like Python is trying to do to introduce tracing GC. Use RC when you can't use the tracing GC.
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#63Finally, Java arrives to our browsers! Maybe we could use it to write some small applications with it, let's call them "applets".
Let's call this language Java Script so that it's clear what its narrowly defined intended purpose is.
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#64Finally, Java arrives to our browsers! Maybe we could use it to write some small applications with it, let's call them "applets".
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#65Maybe I'm old but, we already had this... it was called the tag and it let you embed Java applets. We also had Java Web Start. I feel like this solution in superior to both those things but it still feels like a step backwards.
Also, object tag let languages compete on the quality of their runtime. This also doesn't allow that. You can't ever do better than V8, and V8 isn't going to care about features unique to your language.
The main win is that the browser will keep the WASM interpreter/JIT up to date for you, and it will drop OS privs for you, and it will download and cache the bytecode for you.
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#66Exciting to see - this along with tail call support is opening the door to Scheme in the browser too: https://spritely.institute/news/scheme-wireworld-in-browser....
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#67It'll be interesting to see how & when js-on-wasm comes about that uses wasm-gc.
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#68+ Nice to have would be multithreading without impractically restrictive browser headers
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#69OCaml has not one but two WASM/WasmGC targeting efforts in development: https://discuss.ocaml.org/t/announcing-the-ocaml-wasm-organi... https://discuss.ocaml.org/t/an-update-from-the-ocaml-wasm-or...
Seems like a bad thing? Why are there two separate workstreams?
Time will tell if both survive, they are both under active development. IMHO target different use cases.
Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
#70Earlier quoted context omitted.
Seems like a bad thing? Why are there two separate workstreams?
Maybe adapting the existing js_of_ocaml project is comparatively easier so they might as well try it.
It seems like it’s a relatively easy swap from js_of_ocaml to WASM. That’s the option I’ve chosen for my experiments.