Live data from Hacker News

WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

developer.chrome.com

41–50 of 88 posts

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#41

Interesting - 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.…

Yes, that's definitely true: a single GC will not be optimal for everything, or even possible. Atm interior pointers are not supported at all, for example, but they are on the roadmap for later:

https://github.com/WebAssembly/gc/blob/main/proposals/gc/Pos...

What launched now is enough WasmGC to support a big and useful set of languages (Java, Kotlin, Dart, OCaml, Scheme), but a lot more work will be required here!

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#42
A few days I published a small game built using WASM GC. As far as I know it's among the first. It's a retro vertical scrolling space shooter called Strigoform[0]. It is written in Scheme, the language that Netscape almost put in the browser back in 1995, using the Guile Hoot[1] compiler. If you have the new Chrome it should just work. You can also use Firefox Nightly. Does not work on mobile at the moment as I didn't have time to add a touch control overlay during the game jam, but if you have a Bluetooth keyboard or something you can try though I suspect performance won't be great because I'm just using HTML5 canvas and not WebGL/WebGPU (yet.)

[0] https://davexunit.itch.io/strigoform

[1] https://spritely.institute/hoot/

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#44
post #9

Earlier quoted context omitted.

> I mean sure WASM has allowed C, C++ and Rust to run on the web for awhile now but they aren’t typically languages that web developers tend to have a lot of knowledge of or interest in learning. I think that main use case is not for the web developers who already know the tech needed for web development but actually vice-versa. E.g. you're a C/C++/Rust developer and you want to expose your product as a browser servi…

> E.g. you're a C/C++/Rust developer and you want to expose your product as a browser service - you transpile it to wasm and with a bit of JavaScript you integrate it into the end service Speaking as someone who worked for two companies that tried to do exactly that, it's not that simple. The "bit of JavaScript" ends up requiring huge amounts of work, and the user experience feels un-browser-like, because you're fitt…

You can leverage normal HTML though? Blazor does this with C#, you don't write it all to a canvas element, you just use C# to modify the html itself, basically replacing the 'react' part of the UI.

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#45
post #2

This starts to open a lot of very interesting new doors for web development in general. JavaScript is suddenly no longer the only real game in town it seems. I mean sure WASM has allowed C, C++ and Rust to run on the web for awhile now but they aren’t typically languages that web developers tend to have a lot of knowledge of or interest in learning. But Dart, Kotlin and Java for example, they very much are viable rep…

You can get DOM access with WASM right now by importing host functions. I have managed to write a simple virtual DOM rendering algorithm using WASM GC and imported DOM functions. Only a small bit of JavaScript is needed to instantiate the module and pass in the host functions.

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#46
post #2

This starts to open a lot of very interesting new doors for web development in general. JavaScript is suddenly no longer the only real game in town it seems. I mean sure WASM has allowed C, C++ and Rust to run on the web for awhile now but they aren’t typically languages that web developers tend to have a lot of knowledge of or interest in learning. But Dart, Kotlin and Java for example, they very much are viable rep…

I don't see the "binaryification" of the web platform happening any time soon (if ever). The web is (and should remain) fundamentally about the transmission of documents. Javascript+DOM allows for the dynamic updating of said documents, and this is what the main thread (asynchronous event loop) is all about. For all "heavy lifting," the logic should go into worker threads, where there isn't any DOM access anyway. I t…

There are basically two variants of the web: The document web and the application web. I think there's space for both.

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#47
post #38
post #13

Earlier quoted context omitted.

We basically took a 10 years delay to get back the productive plugin based frameworks from 2010.

But now there's a chance they'll run on the iPhone.

Safari is still behind, as naturally Apple would rather have native apps.

The same reason why Flash was a persona non grata still apply.

Safari is the only reason why we still don't update CVs from Web Developer into ChromeOS Developer.

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#48
post #15

So the browsers are becoming the new Flash players?

Yes, finally. Now with Unity, Flutter, Qt, Blazor, .... as alternative to Flash tooling.

I mean we do also have Flash emulators that run on WASM, if we wanted to take it to a more literal level

Re: WasmGC – Run GC languages such as Kotlin, Java in Chrome browser

#49

I would really like for WASM to get some DOM manipulation capabilities. That would drive support for it for me, but the tasks I work on are just not compute heavy on the frontend

You can already do DOM stuff by importing host functions.
Post reply on HN