Top
Best
New

Posted by kaycebasques 2 days ago

GHC now runs in the browser(discourse.haskell.org)
355 points | 124 commentspage 2
de6u99er 2 days ago|
Serious question. Is Haskell still a thing?
srid 2 days ago||
https://emanote.srid.ca is written in Haskell.

(I'm the author)

teruakohatu 2 days ago|||
Pandoc is an extremely popular Haskell tool.
whateveracct 2 days ago|||
https://mercury.com
simonmic 2 days ago|||
Yes, it's still a thing.
lrvick 2 days ago||
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 2 days ago|||
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 2 days ago||
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 2 days ago||
> 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 2 days ago||
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 2 days ago|||
> 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 2 days ago||
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 1 day ago|||
Interested in why you consider Zig's precompiled WASM blob full source bootstrapping, is it because it's shipped by first party?
lrvick 1 day ago||
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 1 day ago|||
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 1 day ago||
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 1 day ago||
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 2 days ago||
Is it just me or is it actually impossible to type anything?
mananaysiempre 2 days ago||
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 2 days ago||
Thanks, I have given up waiting it appears to take minutes on a phone.
internet_points 2 days ago|||
Hm, works fine here (Firefox on Ubuntu).

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

LelouBil 2 days ago||
I thought you were talking about typing in Haskell at first lol.
edbaskerville 2 days ago||
They were! Typing...in Haskell...on a keyboard...on their screen...
syahlanah 2 days ago||
[flagged]
buggery 2 days ago||
Interesting technical achievement but what would this be used for in practical terms?
s-macke 2 days ago||
I will give a lecture about Haskell next week and might use this website for demonstration.
anon291 2 days ago|||
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 2 days ago|||
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 2 days ago|||
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 2 days ago||
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 2 days ago|||
yeah why would anyone want to run code on a website
bqmjjx0kac 2 days ago|||
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 2 days ago|||
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 2 days ago||||
This is a show case of the wasm backend
whateveracct 2 days ago|||
GHC is built with GHC lol
swannodette 2 days ago|||
Loading 50mb of WASM is a big tradeoff just to run code on a website.
extraduder_ire 1 day ago|||
For comparison: the homepage of cnn.com right now is 33.37MB on my machine. 16.82MB of which is JavaScript.
tuveson 2 days ago||||
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.
wslh 2 days ago|||
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 2 days ago|||
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 2 days ago|||
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 2 days ago|||
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 2 days ago||
We are? Please share.
kreyenborgi 2 days ago|||
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 2 days ago||||
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 2 days ago||||
https://joyful.com/Haskell#What+are+some+Haskell+apps
whateveracct 2 days ago|||
https://mercury.com
pkage 2 days ago|||
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 2 days ago||
Teaching