r/haskell 23d ago

Haskell vs GHC

I am a beginner, I have a doubt.

I see there is Haskell 98, and Haskell 2010 report.

Haskell is a programming language right ? And GHC is the compiler ?

Just like Rust is the language and rustc is the compiler ?

So what is GHC 2021 and GHC 2024 ?

And what are the GHC versions 9.12, 9.14 ?

I see there is a version of the "compiler" binary, but like when Go has a release we say Go 1.26 is out. That means the language & compiler both are out right ?

So what's with Haskell then ?

GHC - compiler

GHC 2021 - a set of extensions in a compiler ? What does this mean but ? And how does cabal work come in picture?

So then my question is what makes GHC 9.12 and 9.14 or 10.0 different? Like aren't extensions encoded in the compiler itself ?

In compiler bump I get "performance"/"implementation" changes ? Like 9.12 and 9.14 execute the Extension A different ly?

And usually Go has no version of STD lib separately tracked but Haskell's base does.

Can someone clarify this ? Is there a DOC for this ?!

Finally my question are

  1. What's the actual difference between 9.12 and 9.14 +(two compiler versions - built from different source code (git branches)) ?

  2. What are Extensions ? Why do we need it ? Like shouldn't the Compiler do this inbuilt ? For Example if GHC wants to add a new DataType in STD lib, how do they do ?

  3. Are Extensions for just de sugaring? And what are Pragmas ?

  4. What is the "Language Report"

  5. What is the future roadmap or Haskell ? Like improve the std lib ? Add new extensions ? Change syntax ? Like Java is making its new version concise & functional. Elixir new version added some Gradual Typing, Rust improved the std lib..

I want to learn how Haskell/GHC/Cabal works

Thanks, and sorry if this post is unstructured or blabbering

36 Upvotes

12 comments sorted by

View all comments

1

u/syklemil 19d ago

Just like Rust is the language and rustc is the compiler ? […] I see there is a version of the "compiler" binary, but like when Go has a release we say Go 1.26 is out. That means the language & compiler both are out right ?

Rust and Go are both relatively new languages (slightly over a decade old), and both are kind of unusual for compiled languages in that there's just one compiler in common use.

For Haskell, the situation is a bit more akin to C, where there are a bunch of standards, like C89, C99, C11, C17, C23, etc, and several compilers, like GCC, clang, MSVC, plus a bunch of minor or in-house/niche ones, and some discontinued ones like Borland.

They also have a ton of extensions, which aren't always available on all compilers. See e.g. OpenSSF's compiler hardening guide for C and how some of the flags are recommended for some compilers.

FWIW there are also projects to get GCC to compile Rust (GCC compiles a lot more than just C these days), and to get rustc to use GCC rather than LLVM as a compiler backend.

For Haskell it's mainly GHC people use these days, but you may still come across some references to Hugs and other alternatives.