Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What language is Haskell written in?

Also (besides the title question), is there source code available for different impure Haskell functions like IO?

I don't mean the Haskell side of the code, but whatever Haskell implements to do IO.

like image 844
Anton Avatar asked May 28 '14 13:05

Anton


1 Answers

Haskell implementations are written in a range of languages.

For example, GHC is:

  • runtime: a mixture of C, assembly and C--
  • compiler: Haskell, Happy (for parsing), and Alex (for lexing)
  • libraries: Haskell and a few C bindings, a little assembly and C--

The primops are the native instructions of the runtime. They in turn are implemented in the runtime via C, C-- and assembly fragments.

IO in particular is mediated via the IO manager, and via foreign libraries of IO primitives.

like image 67
Don Stewart Avatar answered Nov 10 '22 02:11

Don Stewart