https://discourse.haskell.org/t/ghc-now-runs-in-your-browser/13169 Haskell Community Ghc now runs in your browser Show and Tell TerrorJack October 25, 2025, 1:45pm 1 haskell-wasm.github.io ghc-in-browser ghc itself can now run purely client-side in the browser, here's a haskell playground demo. terms and conditions apply, and i'll write up more detailed explanation some time later, but i thought this is a cool thing to show off how far the ghc wasm backend has advanced :slight_smile: 82 Likes jaror October 25, 2025, 2:01pm 2 This is very cool! I wonder how easy it would be to load some packages; cabal in the browser when? I'm also wondering how usable Agda in the browser would be. 3 Likes jaror October 25, 2025, 2:02pm 3 I think I found a bug: ghc options persist even after I change them. Edit: this has been fixed! Also -with-rtsopts=-s does not work, sadly. Edit: Ah, that's because it is interpreted. 3 Likes ad-si October 25, 2025, 3:46pm 4 This is awesome! Perfect for building a fully interactive Haskell online course! :star_struck: simonmic October 25, 2025, 5:39pm 5 Awesome work! Browser reports: * In Brave, after a few seconds unresponsive, it loads. It shows: "Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see GitHub - microsoft/monaco-editor: A browser based code editor You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker". The Run button works. * In Safari, the same message, but the Run button remains disabled. 3 Likes ApothecaLabs October 25, 2025, 8:05pm 6 Excellent work - the efforts to bring Haskell to WASM are a huge boon to our ecosystem and userbase! chrisdone October 25, 2025, 9:39pm 7 Can't run it on my tablet (wasm), curious: is this running the type checker or also code gen to wasm? 1 Like jaror October 25, 2025, 9:46pm 8 It runs the code, but it seems like it uses the bytecode interpreter. 1 Like SeungheonOh October 26, 2025, 2:12am 9 What modifications were to GHC for it to be compiled to WASM? 1 Like TerrorJack October 26, 2025, 1:13pm 10 # jaror: I wonder how easy it would be to load some packages; cabal in the browser when? cabal won't work in the browser due to lack of process support; but it's possible to use wasm32-wasi-cabal to precompile some third party packages to wasm and make this playground support them as well. # jaror: I'm also wondering how usable Agda in the browser would be. you might be interested to check GitHub - agda-web/agda-wasm-dist: Distributions of Agda executable compiled into WebAssembly.; afaik they even compiled GitHub - agda/agda-language-server: Language Server for Agda to wasm, not sure how usable it is currently # jaror: I think I found a bug: ghc options persist even after I change them. thanks for the report! i pushed an update which should have fixed it. # jaror: Ah, that's because it is interpreted. that's right; ghc in browser can't invoke the c compiler and it can only interpret haskell modules via bytecode. 1 Like TerrorJack October 26, 2025, 1:23pm 11 # simonmic: Browser reports: thanks for the reports! a few seconds of freeze during start-time is expected, since it needs to download ~50M of a rootfs tarball and extract it, then link the ghc library and all its dependencies. as for safari, it's strange since i i just landed a workaround for a webkit bug that breaks the wasm dynamic linker a few days ago, i'll take a closer look later. # SeungheonOh: What modifications were to GHC for it to be compiled to WASM? the ghc library already mostly works when compiled to wasm, and it can parse/typecheck/desugar stuff. the bottleneck is the linker/ loader part, for it to be useful it needs to be able to dynamically load and execute haskell code. i landed a couple of ghc patches recently to push towards that direction, and the last one that gets us towards the haskell playground (not landed yet) is Draft: Support running GHC fully client-side in the browser (!15000) * Merge requests * Glasgow Haskell Compiler / GHC * GitLab 8 Likes ashokkimmel October 26, 2025, 3:45pm 12 Which packages are installed by default? 2 Likes doyougnu October 26, 2025, 8:06pm 13 now chrome will consume even more memory :stuck_out_tongue: Awesome work! 2 Likes TerrorJack October 27, 2025, 10:05am 14 # ashokkimmel: Which packages are installed by default? the ghc library and its transitive dependencies. jarm November 1, 2025, 6:29pm 15 # TerrorJack: t's possible to use wasm32-wasi-cabal to precompile some third party packages to wasm and make this playground support them as well. Can you elaborate? Do you have any end-to-end examples/instructions for this? I am a live coding musician and have been trying to get Tidal running on the web for years: tidal: Pattern language for improvised music 1 Like theGhostJW November 1, 2025, 8:39pm 16 see also: [haskell-play-logo] play.haskell.org Haskell Playground github.com [play-haskell] GitHub - haskell/play-haskell: Haskell Playground Haskell Playground which I presume isn't wasm MangoIV November 2, 2025, 10:44am 17 jup, https://play.haskell.org runs server side. 2 Likes TerrorJack November 2, 2025, 3:55pm 18 # jarm: I am a live coding musician and have been trying to get Tidal running on the web for years: tidal: Pattern language for improvised music it seems tidal does not make use of ghc api? in which case you could just write a small wasm frontend app that imports the tidal library and exports the haskell functions to be invoked by the frontend. there's 15. Using the GHC WebAssembly backend -- Glasgow Haskell Compiler 9.15.20251101 User's Guide, but if there's something missing from the documentation feel free to raise an issue. 1 Like Bodigrim November 2, 2025, 4:22pm 19 @TerrorJack I think the point of tidal is that you load it into GHCi and live code music inside GHCi session. 1 Like TerrorJack November 2, 2025, 4:36pm 20 i see. in which case, i hope testsuite/tests/ghc-api-browser * master * Glasgow Haskell Compiler / GHC * GitLab can be used as a starting point for building ghc api based apps in the browser. 2 Likes next page - Related topics Topic Replies Views Activity Frontend live-coding via ghci 0 210 April 17, Announcements 2025 Using GHC's JavaScript Backend in the January Browser | IOG Engineering 0 485 24, 2023 Links Looking for Examples using WASM 7 2430 February Backend 11, 2024 Haskell via WebAssembly on Fastly 4 1869 March 22, 2023 Javascript & WebAssembly backend 18 2560 July 5, 2023 * Home * Categories * Guidelines * Terms of Service * Privacy Policy Powered by Discourse, best viewed with JavaScript enabled