Interest in evaluation of Wasm GC proposal

The Wasm GC workgroup is working on an extension to Web Assembly to support languages which require garbage collection. There is a lot of discussion going on on type system features of this extension: structural vs nominal types and the representation of recursive types are two the main points.

Currently, concrete feedback on this proposal from source languages targeting Wasm (so called producers), is limited to a Java to Wasm compiler. To get the full picture, more input is needed from languages having a different type system than Java.

PureScript is an ideal source language to compile to Wasm GC and use the experience writing such a backend to improve the shape of this new internet standard. PureScript is functional, and we need input from functional languages. Also, PureScript targets the web, so comparison between its current JavaScript backend and a Wasm GC backend on code size as well as performance would be very valuable input.

Main goal of Wasm GC is that it should be a (way) better target for languages which currently target JavaScript. Concrete evaluation criteria are not yet agreed upon, but one should think in the direction of:

  • How simple is it to target Wasm with GC from a source language?
  • Which problems do arise when targeting Wasm GC?
  • Is the provided type system complete enough to model source language types?
  • Can data be reflected faithfully, or are many casts needed when targeting Wasm GC?
  • Is performance of Wasm modules on par or better than when compiling to JavaScript?

So, my question is:

Is there any interest in the PureScript community to help writing a backend targeting Wasm GC and share their experience with the working group?!?

I’m currently not in the situation to fully immerse myself in such a project, but I’d love to support it! I can imagine that the PureScript maintainers are already fully occupied, but I hope they will be open to provide helpful information in developing such a backend. Maybe there are some sponsors interesting to fund this work? Maybe there are some computer science students looking for a masters thesis subject? Doesn’t matter if your not graduating form the Open University in the Netherlands (where I teach) we can still arrange something. Maybe you’re looking for a new challenge during your free evenings? Anybody interested: do reach out!

23 Likes

Well, as part of my master thesis, I’m interested.

6 Likes

Hey @Swordlash! Sounds great. Can you send me a PM?

1 Like

Is this really true?

Wasm doesn’t have access to the DOM, right? To make something like Halogen work using a Wasm GC would mean somehow having both the JS and Wasm backends interoperable?

Goal of the GC proposal is to make JS and the DOM accessible via Wasm by having GC references of an external type :slight_smile:

2 Likes

How does it sound in the light of Compile to WebAssembly · Issue #1177 · purescript/purescript · GitHub (especially last comment)?

Ah! I hadn’t been keeping up with what they’ve been planning for Wasm GC. That sounds very cool. I’ll look into that some more :slight_smile:

1 Like

The group is discussing several ways to do easy and fast JavaScript interop. One goal of a PureScript to Wasm compiler would be to evaluate this.

2 Likes