# MicroHs in the browser

**URL:** <https://discourse.haskell.org/t/microhs-in-the-browser/14055>\
**Category:** Announcements\
**Created:** [May 8, 2026, 12:37pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055 "2026-05-08T12:37:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 12:37pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/1 "2026-05-08T12:37:56Z")

</div>

You can now run interactive `mhs` in your browser.  
[Try it!](https://augustss.github.io/MicroHs/web-mhs/)  
Maybe try it on your phone. 😀

It currently only has the base package included, but it is trivial to make a version that has arbitrary packages (well, those that `mhs` can compile) embedded in the system.

The site consist of a small `index.html` (4K) and a rather hefty `mhs-embed.js` (2.3M). The latter contains the compiler, runtime system, and base package. It is built by `emscripten` to compile the C code to JS and Wasm.

Currently, you cannot access the local file system. So you cannot load or save files. That makes it rather useless. I will happily accept contributions that add file system access.

---

<div class="post-metadata">

**Author:** ![L0neGamer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/l0negamer/32/4536_2.png) [@L0neGamer](https://discourse.haskell.org/u/L0neGamer)\
**Post date:** [May 8, 2026, 12:47pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/2 "2026-05-08T12:47:31Z")

</div>

Cool demonstration!

I’m finding it a little hard to use; lack of arrow keys and pasting makes it tricky to navigate, and it would be nice to be able to run IO so one could do `traverse (print) [1,2,3]` (as was my first instinct).

---

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 12:54pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/3 "2026-05-08T12:54:12Z")

</div>

I have to figure out arrow keys and pasting. But ctl-p etc work.

You can run `traverse print [1,2,3] >> return ()`. You expression must either be `IO ()` or have `Show`.

---

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 2:54pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/4 "2026-05-08T14:54:19Z")

</div>

Arrow keys and pasting should work now. There’s probably more work needed on copy&paste.

---

<div class="post-metadata">

**Author:** ![simonmic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/simonmic/32/1796_2.png) [@simonmic](https://discourse.haskell.org/u/simonmic)\
**Post date:** [May 8, 2026, 5:55pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/5 "2026-05-08T17:55:23Z")

</div>

Congrats! Amazing!

I enjoyed the still-minimal UI. I tried it as a calculator, but it’s a little floating point challenged:

```haskell
> 0.5
Infinity

```

---

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 6:24pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/6 "2026-05-08T18:24:27Z")

</div>

Yeah, I need to debug the FP.

---

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 7:54pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/7 "2026-05-08T19:54:07Z")

</div>

I’ve uploaded a version where floating point works.

---

<div class="post-metadata">

**Author:** ![AshleyYakeley](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/ashleyyakeley/32/1264_2.png) [@AshleyYakeley](https://discourse.haskell.org/u/AshleyYakeley)\
**Post date:** [May 8, 2026, 9:26pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/8 "2026-05-08T21:26:09Z")

</div>

Could you use MicroHs to compile to (Pallas) [PLAN](https://opfn.gitbook.io/pallas/overview/overview#plan-1)?

---

<div class="post-metadata">

**Author:** ![augustss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/augustss/32/887_2.png) [@augustss](https://discourse.haskell.org/u/augustss)\
**Post date:** [May 8, 2026, 10:08pm UTC](https://discourse.haskell.org/t/microhs-in-the-browser/14055/9 "2026-05-08T22:08:48Z")

</div>

Since the last step before going to combinators is untyped lambda calculus, I would think you could get PLAN from that.

You’d have avoid anything Haskell specific, say forkIO or MVar, of course.
