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!