Top
Best
New

Posted by kaycebasques 11/1/2025

GHC now runs in the browser(discourse.haskell.org)
358 points | 126 commentspage 2
de6u99er 11/1/2025|
Serious question. Is Haskell still a thing?
srid 11/2/2025||
https://emanote.srid.ca is written in Haskell.

(I'm the author)

teruakohatu 11/1/2025|||
Pandoc is an extremely popular Haskell tool.
whateveracct 11/1/2025|||
https://mercury.com
simonmic 11/2/2025|||
Yes, it's still a thing.
lrvick 11/1/2025||
We cannot even include it in stagex because there is still literally no way to compile it from source and thus no way to do a real reproducible build, and there is no one left that cares about the language enough to do this.

Honestly it has to be regarded as a dead language until this is resolved.

nh2 11/1/2025|||
Interesting logic:

Declare something "dead" because it does not fulfill [extremely niche usecase that currently only few people care about] (boostrapped builds) and thus couldn't "even" be included in [project of the post author that takes a while to even find] (I eventually figured it must be referring to https://stagex.tools).

There are probably 100x more people interested in Haskell than in build-bootstrapping (the Haskell reddit alone has 16k weekly users).

What's next, calling JavaScript a dead language until it focuses on dependent typing?

(I think bootstrappable builds are a good thing to strive for, but that should not be confused with language usage or what people really care about.)

lrvick 11/2/2025||
I said it has to be treated as a dead language. I did not say it actually is one.

Being able to compile a compiler without binary blobs is a hard prerequisite to using that language for any application where security matters.

A language can have an active community and still be unsuitable for any real world use cases. Fortran is bootstrappable so I consider it more viable than haskell for real world use, even though it has far fewer fans (understandably).

Maybe it is more fair to call haskell an academic language or hobby language since it prioritized language design over basic supply chain security thus far.

If it becomes bootstrappable, then of course all the above critique is immediately retracted.

pyrale 11/2/2025||
> If it becomes bootstrappable, then of course all the above critique is immediately retracted.

So basically you're saying you're just trying to get people to carry water for your project?

> because there is still literally no way to compile it from source

https://gitlab.haskell.org/ghc/ghc/-/wikis/building/#buildin...

I cannot comprehend how you can get to the conclusion that a compiler that was litterally made so that people could hack into it and learn from that has no build documentation.

lrvick 11/2/2025||
My project has no need of Haskell, but if anyone puts in the work to make haskell compileable from only public source code my team and I will put in the work to reproduce, package, and maintain it for the community for free as we do most other languages.

Your link details building GHC with an existing non reproducible GHC compiler binary compiled by a single individual that must be blindly trusted.

Full source bootstrapping means no binary blobs or trust in anyone else needed, which makes supply chain integrity possible. This is a bare minimum for any language to be considered for production use in any environment where security matters.

To me it -is- crazy when a major language compiler skips something so basic, but Haskell did.

To be fair rust team skipped this too, but thankfully rust is popular enough that a community member cared enough about high security applications to write mrustc, a bootstrap rust compiler written in C++. If not for that Rust would be in the same boat as Haskell.

Meanwhile Go and Zig did it right, and have both provided full source bootstrapping instructions from a C compiler since day 1.

pyrale 11/2/2025|||
> Your link details building GHC with an existing non reproducible GHC compiler binary compiled by a single individual that must be blindly trusted.

You mean Hadrian? Its source is shipped with GHC.

Even if you were not to trust Hadrian, the doc also has info about building GHC using make.

> since day 1.

Could it be that languages made around 2010 have learned a thing or two from previous languages?

lrvick 11/2/2025||
Building GHC regardless of using hadrian or make still requires an existing GHC binary. That is the core trust problem.

GHC has a recursive dependency on itself with no way to go back before that loop.

fuhsnn 11/2/2025|||
Interested in why you consider Zig's precompiled WASM blob full source bootstrapping, is it because it's shipped by first party?
lrvick 11/3/2025||
I did not package Zig myself. Does that blob make it into final artifacts? If so that is a bug we should swiftly correct.
nothrabannosir 11/2/2025|||
I dug into this and it turns out there's an active, multi year effort underway to solve exactly this, along the exact ways you´d expect, with references to guix and bootstrappable.org etc, making steady progress: https://discourse.haskell.org/t/what-s-needed-to-bootstrap-g...

Reading through that thread gives me a very different idea of the state of haskell than I got from reading your comments.

lrvick 11/2/2025||
Efforts pop up every once in a while, usually with no results. As I said elsewhere, if they actually pull it off this time then my tone changes to one of willingness from my team and I to put in the work to use these efforts to support deterministic multi-signed builds in stagex.

It would make GHC (and pandoc) something we could have in tree which would be awesome. I am just annoyed it seems like such a low priority.

nothrabannosir 11/2/2025||
This entire thread, including your original comment, isn’t really about your efforts though. It was about Haskell.

As I said : I read your comments, formed an idea based on that, dug deeper to see for myself, and got a completely different picture.

Whether that is because of how you write or because of how I read I’ll leave for you to decide.

pjmlp 11/1/2025||
Is it just me or is it actually impossible to type anything?
mananaysiempre 11/1/2025||
Just you. Once the editor actually loads (turning the “Haskell source” pane on the left from the page background’s deep violet into a dark gray and displaying a “hello world” program), I can type perfectly fine. And I’m using a browser based on WebKitGTK, which is not exactly known for its stellar compatibility.
pjmlp 11/1/2025||
Thanks, I have given up waiting it appears to take minutes on a phone.
internet_points 11/2/2025|||
Hm, works fine here (Firefox on Ubuntu).

But getLine doesn't seem to be implemented, so there is output but not yet input :)

LelouBil 11/1/2025||
I thought you were talking about typing in Haskell at first lol.
edbaskerville 11/1/2025||
They were! Typing...in Haskell...on a keyboard...on their screen...
syahlanah 11/1/2025||
[flagged]
buggery 11/1/2025||
Interesting technical achievement but what would this be used for in practical terms?
s-macke 11/1/2025||
I will give a lecture about Haskell next week and might use this website for demonstration.
anon291 11/1/2025|||
Compilers are complicated. WASM has been a priority for the Haskell community for a while. Demonstrating GHC's ability to compile itself to WASM is thus a show that it is robust enough to compile a very complicated program into this backen.d
kreyenborgi 11/1/2025|||
For one, it demonstrates how far the ghc wasm backend has come, in that such a large system as ghc itself can now run in wasm
IshKebab 11/1/2025|||
Have you ever used Godbolt? The Rust playground? The Typescript's playground? The Go playground?

It lets you have that without the pain of hosting compilers server side.

westurner 11/1/2025||
From "WebR – R in the Browser" (2025 https://news.ycombinator.com/item?id=44999706 :

> jupyterlite-xeus builds jupyterlite, Jupyter xeus kernels, and the specified dependencies to WASM with packages from conda-forge or emscripten-forge.

jupyterlite/xeus https://github.com/jupyterlite/xeus

There may be an easy way to wrap GHC with jupyterlite/xeus, with Haskell's lazy evaluation; xeus-haskell or xeus-ghc?

jes5199 11/1/2025|||
yeah why would anyone want to run code on a website
bqmjjx0kac 11/1/2025|||
It would be more plausibly practical if GHC could now target wasm, but this announcement is actually about being able to run the compiler itself in the browser.
tempay 11/1/2025|||
It can target wasm, the point of the post is that it’s now mature enough to be able to build itself for wasm and run in a browser.
Jaxan 11/1/2025||||
This is a show case of the wasm backend
whateveracct 11/1/2025|||
GHC is built with GHC lol
swannodette 11/1/2025|||
Loading 50mb of WASM is a big tradeoff just to run code on a website.
tuveson 11/1/2025|||
Loading time is pretty rough, but it seems responsive enough after the initial load. Probably as fast or faster than downloading and installing GHC locally.
extraduder_ire 11/2/2025||||
For comparison: the homepage of cnn.com right now is 33.37MB on my machine. 16.82MB of which is JavaScript.
wslh 11/1/2025|||
I would assume that in the near future one can preload, cache, update selected WASM packages. I also imagine that sooner than that we can preload open models in the browser to run the natively instead of only invoking third parties (e.g. window.ai in the DOM)
fuzzy_biscuit 11/1/2025|||
I think the immediate and obvious case would be educational materials. Other than that, technical achievements need not always be practical to be cool :)
billti 11/1/2025|||
That’s one of the primary reasons we built the tooling for Q# to run in the browser (by writing in Rust and compiling to wasm). The “try with copilot” experience [1] and the “katas” for learning [2] all have a full language service and runtime in the browser.

https://quantum.microsoft.com/en-us/tools/quantum-coding

https://quantum.microsoft.com/en-us/tools/quantum-katas

linhns 11/1/2025|||
Agreed. Too many people said Haskell is only for academia, yet we’re seeing more quality software being released in Haskell over the past few years.
GiorgioG 11/1/2025||
We are? Please share.
kreyenborgi 11/1/2025|||
I don't have the same impression, but https://github.com/PostgREST/postgrest and https://github.com/koalaman/shellcheck are some popular ones that may be useful to hn'ers.

And https://github.com/mchav/dataframe?tab=readme-ov-file#datafr... is a library/framework that has had quite some velocity lately

Zambyte 11/1/2025||||
Pandoc is the first thing that comes to mind, but I also believe I have seen an uptick in software that I use being written in Haskell lately, though I can't remember what else off the top of my head.
simonmic 11/2/2025||||
https://joyful.com/Haskell#What+are+some+Haskell+apps
whateveracct 11/1/2025|||
https://mercury.com
pkage 11/1/2025|||
In addition to the other responses, it's also worth noting that wasm itself is useful outside of the web itself; e.g. in containerized applications.
0x264 11/1/2025||
Teaching