Asterius - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

TheMatten

https://asterius.netlify.app/roadmap.html#q1

A longer term goal beyond Q1 is upstreaming Asterius as a proper wasm backend of GHC.

Does this mean that we can expect official support for web in GHC at some point? :smile:

Georgi Lyubenov // googleson78

do you know what's currently holding asterius back from entirely replacing ghcjs?
and also, how is asterius "keeping up" with ghc, while ghcjs is falling behind? is (and how) asterius somehow "less work" to adapt to new ghc versions?

TheMatten

do you know what's currently holding asterius back from entirely replacing ghcjs?

Seems like it's matter of "finishing it" :big_smile: - Roadmap and issues mention goals to make C/C++ integration fully work and to finish and polish runtime

and also, how is asterius "keeping up" with ghc, while ghcjs is falling behind? is (and how) asterius somehow "less work" to adapt to new ghc versions?

I guess it may have advantage of starting on newer GHC version, plus keeping up with upstream seems to be important given the goals
Maybe it's because of smaller amount of changes to frontend part of the compiler, but I'm really just guessing here

Torsten Schmits

what does the compiler achieve at the moment? is it usable for toy projects?

TheMatten

They have some working demos here: https://github.com/tweag/asterius#demos

A Haskell to WebAssembly compiler. Contribute to tweag/asterius development by creating an account on GitHub.
Sridhar Ratnakumar

I wonder if Obsidian and Tweag are working entirely separately, or if there is some collaboration going on.

Isaac Shapira

Separately @Sridhar Ratnakumar

Isaac Shapira

Also WebGHC has not had an update in a loooong time

Isaac Shapira

but Asterius is active

Peter J. Jones

It's been a couple years since I looked at WASM. Can you access the DOM now?

Isaac Shapira

@Peter J. Jones https://www.tweag.io/blog/2019-12-19-asterius-diagrams/

Asterius compiles Haskell code into WebAssembly code to be executed in a browser or in Node.js. It has reached a new milestone by being able to compile the diagrams library and its dependencies.
Isaac Shapira

You can see it in action!

Peter J. Jones

That's pretty exciting. What are the mjs files for?

Isaac Shapira

@Peter J. Jones Idk, I have not made use of web assembly myself yet

Isaac Shapira

but the link there clearly shows it working, which means it has dom access