The Try Haskell service, which @chrisdone has been running for more than a decade and a half, has recently been shut down. While I find it completely understandable and, indeed, normal that interests and priorities shift and open source projects get abandoned over time, this particular one has a very visible effect: the “Try it!” box on https://haskell.org is now broken without any indication in the UI.
I think something must be done here, at least to fix the Haskell homepage. Whether that is removing the “Try it!” box, reinstating the tryhaskell backend somewhere else, replacing the backend with the playground (which only works if no state is needed across evaluations, and it does seem like the current JS allows some kind of persistent filesystem (?)), or something else, is not something I have a strong opinion on. The playground is there to be used for this purpose, if people want.
As far as I know (but I’m happy to be corrected), the GHC WASM work is cool enough now to be able to compile GHC to workable WASM, but not enough to make ghci work. (My source here is the last section of this post.) The demo of this here downloads a ~49 MB blob, which is excessive for haskell.org.
There is also a WASM build of MicroHS, apparently, that does have an interpreter demo; this one is particularly nice because the downloaded blob is just 2.6 MB, or 1.6 MB gzip’d if your browser does that. It does still take about 9 seconds to get to a prompt on my PC and ~16 seconds on my smartphone, both of which have fast CPUs. (These timings are from a hot browser cache.) This still feels very long for a quick demo on the Haskell home page.
MicroHs is a defensible choice. I’m not sure someone that wants to try Haskell quickly in a browser cares about every single GHC affordance. It’s a 2MB bundle so it wouldn’t overwhelm most browsers but maybe work can be done to make it slimmer for this purpose.
If be happy to help creating a bundle for trying Haskell. I think the smallest size we can hope for is about 1.3M. I will also investigate why the startup is so slow.
I’m afraid I don’t remember what tryhaskell looked like, so I’m not sure what we are aiming for.
I think this is the same approach as is taken in the GHC WASM demo I already shared in post 3 above (here), which is by the same author. While it’s GHC, and it’s really cool, it’s not a REPL, and it downloads a ~49 MB blob (~52 MB for the miso playground, it seems). I think that’s excessive, although it does load in about 3 seconds on my PC, which is faster than the microhs playground (currently).
EDIT: excessive for haskell.org, I mean, because of its wide reach. 50 MB is a rather large bandwidth-eater for a mobile user on a limited plan, for what is a cute but ultimately (in the current incarnation with the little “23 * 63” tutorial) relatively whimsical feature.
I think a fun upgrade of tryhaskell using wasm would be like
multiple Haskell implementations. MicroHs, Hugs, GHC (with a bandwidth warning)
repl and editor with query string save support for the files and repl history
Have a feature that lets try out packages from Hackage in an easy way. ofc some don’t work in the browser, but many do. Imagine reading Hackage docs and you can just open a browser tab and get a repl for that code!
(Also mailing lists seem broken: Mailman REST API not available …, so haskell.org is looking rather sad.)
There’s a reddit thread from 17 years ago ‘Try Haskell now with :t and …’ is about the best doco I could find. It is (was) a REPL where you could type expressions, see those eval’d. It supported a few GHCi commands, like :t. But not :l, nor could you enter declarations like data, class, instance, only local decls via let, where. So much less capability than TryMicroHS.
P.S. there seems to be a (dodgy) clone at haskellmooc.co.uk Dunno how long that will survive.
I’m not quite sure who’s done what, but haskell.org’s front page is rejigged; tryHaskell is gone; there’s a new ‘Try in the Playground’ which loads a random example hs module; you can edit and/or run; you can choose which release of ghc to try it against. Cool! thank you.
(Also it runs on my ancient Windows machine/browser, unlike MicroHS.)
(Also mailing lists are back. thank you, thank you)
EDIT: this is a temporary solution to un-break the front page. And regarding the playground: happy that you like it, but it was already linked from the front page before, just a little bit less conspicuously.