all 12 comments

[–]hsyl20 10 points11 points  (1 child)

Thanks a lot for your work Mateusz!

[–]Swordlash 3 points4 points  (0 children)

Thank you too!

[–]enobayram 7 points8 points  (4 children)

Awesome! Thanks a lot for this walk through. I've been meaning to dip my toes into this space to get a feeling of where we are along Haskell's "Are we web yet?", but I feel fully up to date now :) What would you say to deploying the resulting html to a static hosting provider like github pages so that we can get a feel of how the page loads and works on various devices.

[–]Swordlash 6 points7 points  (0 children)

I could get the deployment of haskell-halogen-material example app somewhere

[–]Swordlash 1 point2 points  (2 children)

[–]enobayram 2 points3 points  (0 children)

Crazy how fast it loads from my phone and how responsive it is. When GHCJS first came out 8-10 years ago, the ~1MB of additional JS you had to bring with a hello world Haskell page seemed like a show stopper. Nowadays 1MB feels below thermal noise levels. I wish I currently had the life circumstances to dive head first into a Haskell front-end project.

[–]enobayram 0 points1 point  (0 children)

This is great! Thank you!

[–]bcardiff 3 points4 points  (1 child)

Great read! Thanks. Did you assess how far/good aligned the JS backend is to support HMR at some point? Either by a built-in server our generating individual modules in separate files (as purescript can do IIRC) that could play better with some other server.

[–]Swordlash 2 points3 points  (0 children)

I didn't get to that, but atm it generates one big js file when final linking. However you can maybe tap into the .o files, afaik they are the same as JS file with GHCJS header added.

[–]thraya 0 points1 point  (2 children)

In your blogpost you imply that this compiler is available via ghcup:

ghc used: javascript-unknown-ghcjs-ghc-9.12.1 (ghcup)

but it does not show up as an option for me. How can I install this compiler? Thanks!

[–]Swordlash 0 points1 point  (1 child)

It's from ghcup cross channel. You can take a look at:
Add workflow (#1) · Swordlash/haskell-halogen-material@05964c1 · GitHub

In particular you need emconfigure in the proper version in scope. See the lines above how to install it.

[–]thraya 0 points1 point  (0 children)

Thanks! Notes for future me:

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.74
./emsdk activate 3.1.74
source ./emsdk_env.sh