Hacker News new | ask | show | jobs
by ghostwriter 1691 days ago
> You've never compiled GHC from source? How long does that take on your machine?

I have, but the point is that I don't have to, because there are transparent distributed builds in Nix that I utilise when I want to compile something big, as you say "real-world", fast. I split software into many small self-contained packages and delegate the work of compiling it all to remote machines configured for faster compilation times, and then I just pull complete binaries onto my laptop (https://nixos.org/manual/nix/unstable/advanced-topics/distri...). Subsequent changes in smaller packages are rebuilt incrementally.

My point and the answer to your question ("And why is this state of affairs tolerated for decades?") is that GHC doesn't have to implement its own version of dev environment bootstrapping, distributed builds and other niceties as part of their core tooling, because it's already solved on other level of dev-infra tooling, they can just provide links to working solutions and explain them, for instance haskell.nix (https://github.com/input-output-hk/haskell.nix)

1 comments

Haskell is the only language where you seem to need Nix. That alone make a big difference for people trying to get into Haskell. I'd say it's also the only language where you seem to need dev-infra tooling. I can see how using Nix helps, but saying that "it's already solved on other level of dev-infra tooling" is basically a way to confirm "This language has some of the worst tooling I've ever encountered in my life.", which was the initial assertion.
> Haskell is the only language where you seem to need Nix

that's not true, at least not in a larger context of available languages. There are C, C++, and a few other emerging language environments such as Mercury and ATS that can benefit from the same Nix toolchain right now, and their maintainers don't have to re-invent the wheel of packaging and distribution, as Nix solves that for them in a generic way.

> is basically a way to confirm "This language has some of the worst tooling I've ever encountered in my life."

For that you need to define criteria that allow you to identify the "worst" example. It is going to be the worst if you expect a monolith all-included distribution that has its own implementation of the same generic dev tooling approach (reproducibility, tracking of dependency sources, versioning etc), such as Rust Cargo or Go Modules. But these criteria won't match with the world where I see every software component to be a generic build instruction that Nix manages to provide regardless of the underlying language compiler.

> that's not true, at least not in a larger context of available languages. There are C, C++, and a few other emerging language environments such as Mercury and ATS that can benefit from the same Nix toolchain right now, and their maintainers don't have to re-invent the wheel of packaging and distribution, as Nix solves that for them in a generic way.

Fair point, though Haskell seem to be the only language where Nix is the accepted solution to packaging and distribution.

> For that you need to define criteria that allow you to identify the "worst" example. It is going to be the worst if you expect a monolith all-included distribution that has its own implementation of the same generic dev tooling approach (reproducibility, tracking of dependency sources, versioning etc), such as Rust Cargo or Go Modules. But these criteria won't match with the world where I see every software component to be a generic build instruction that Nix manages to provide regardless of the underlying language compiler.

That's a reasonable point of view to have if you already know Nix. Most people don't, so they see Nix as Haskell-specific, except it's not and you now have to learn a general tool which usually takes way more time than learning Cargo or Go modules.

The point is that embracing Nix makes the learning curve of Haskell way steeper currently, especially when you also have GHC, Stack and Cabal. Maybe it will pay off in a few years when everyone uses Nix, but that's not the case today.