haskell-jp / mokumoku-online #81 at 2025-12-28 18:04:01 +0900

makeMistakesToLearnHaskellの進捗: https://github.com/haskell-jp/makeMistakesToLearnHaskell/commit/efea0e30df6997fdfde54676e0da9de06a1d07b9
Webアプリケーション作りについては、Nixの勉強をしつつGHCのバックエンドをどうしようか検討しています。
:writing_hand:
https://discourse.haskell.org/t/ghc-now-runs-in-your-browser/13169
◦ 詳細は明かされていない様子。あまり使わない方がいい?
◦ GHCiが使えないので大分工夫が要る
◦ 外部パッケージを使うのも大変そう
◦ サイズはかなりマシ(50MBくらい)
◦ 関連:
▪︎ https://github.com/haskell-wasm/ghc-in-browser/tree/gh-pages
▪︎ https://gitlab.haskell.org/haskell-wasm/ghc-wasm-meta
• とりあえずNixでインストールしてみた。
• container2wasmを使った実装: https://vaibhavsagar.com/blog/2024/07/03/ghci-in-the-browser/ 確実そう。いろんなバージョンのGHCやHaskellのパッケージが使える。ただしサイズがでかい(220MBくらい)。
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html にこんな記述が!
The GHC wasm backend supports the GHCi feature via a nodejs dyld script that provides RTS linker functionality and bootstraps the external interpreter
Additionally, the wasm backend’s GHCi supports the browser mode to allow live-coding the frontend using GHCi. This requires the ws library to be installed and passed to the dyld script via the NODE_PATH environment variable
あー、でもこれはGHCi自身をWasmにした話とは違うな