Difference between revisions of "Implementations"

From HaskellWiki
Jump to navigation Jump to search
(→‎Haskell 2010: add microhs)
 
(28 intermediate revisions by 13 users not shown)
Line 1: Line 1:
Below you find a list of all Haskell implementations. The recommend way to install Haskell on your computer is through the the [http://hackage.haskell.org/platform/ Haskell Platform].
+
Below you will find a list of all Haskell implementations. The [https://www.haskell.org/downloads/ recommended] way to install Haskell on your computer is through [https://www.haskell.org/ghcup/ GHCup] and/or [[Stack|The Haskell Tool Stack]].
   
   
== Glasgow Haskell Compiler (GHC) ==
+
== Haskell 2010 ==
  +
 
=== Glasgow Haskell Compiler (GHC) ===
 
[[GHC]] is an optimising compiler for Haskell, providing many language extensions. GHC is the de facto standard compiler if you want fast code. GHC is written in Haskell (plus extensions), and its size and complexity mean that it is less portable than Hugs, it runs more slowly, and it needs more memory. However, the programs it produces run ''much'' faster.
 
[[GHC]] is an optimising compiler for Haskell, providing many language extensions. GHC is the de facto standard compiler if you want fast code. GHC is written in Haskell (plus extensions), and its size and complexity mean that it is less portable than Hugs, it runs more slowly, and it needs more memory. However, the programs it produces run ''much'' faster.
   
There is also an interactive environment, GHCi, which is like Hugs but supports interactive loading of compiled code. GHC provides profiling for time and space, and supports concurrent and (recently) parallel programming. It is available for most common platforms, including Windows, Mac OS X, and several Unix variants (Linux, *BSD, Solaris).
+
There is also an interactive environment, GHCi, which is like Hugs but supports interactive loading of compiled code. GHC provides profiling for time and space, and supports concurrent and parallel programming. It is available for most common platforms, including Windows, Mac OS X, and several Unix variants (Linux, *BSD, Solaris).
   
  +
The currently [https://www.haskell.org/downloads/ recommended] way to install GHC and some related tools is with [https://www.haskell.org/ghcup/ GHCup]. There is also an [https://docs.haskellstack.org/en/stable/install_and_upgrade/ installation guide] for [[Stack]].
The GHC team recommends installing the [http://hackage.haskell.org/platform/ Haskell Platform] to get GHC.
 
   
  +
Other methods of installation are listed at [[Distributions]].
== Hugs ==
 
[[Hugs]] is a small, portable Haskell interpreter written in C runs on almost any machine. Hugs is best used as a Haskell program development system: it boasts extremely fast compilation, supports incremental compilation, and has the convenience of an interactive interpreter (within which one can move from module to module to test different portions of a program). However, being an interpreter, it does not nearly match the run-time performance of, for example, GHC, nhc98, or HBC. It is certainly the best system for newcomers to learn Haskell. Hugs 98 is conformant with Haskell 98. Available for all Unix platforms including Linux, DOS, Windows 3.x, and Win 32 (Windows 95, Win32s, NT) and Macintoshes. It has many libraries including Win32 libraries, a foreign interface mechanism to facilitate interoperability with C, and the Windows version has a graphical user interface called [[WinHugs]]. Explanations of some common Hugs error messages and their causes can be found on [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/errors.html Simon Thompson's page].
 
   
  +
The previously recommended [[Haskell Platform]] is now deprecated.
== nhc98 ==
 
[http://www.haskell.org/nhc98/ nhc98] is a small, easy to install, standards-compliant Haskell 98 compiler. It provides some advanced kinds of heap profiles not found in any other Haskell compiler. It produces medium-fast code, and compilation is itself quite fast. The compiler stresses the saving of space, that is, it produces small programs requiring comparatively little space at runtime (and it is itself much smaller than the other compilers). It is available for all Unix-like platforms (including Mac OS X, Cygwin/Windows, Linux, Solaris, *BSD, AIX, HP-UX, Ultrix, IRIX, etc.). It is written in Haskell 98, but can be quickly and easily bootstrapped from C sources.
 
   
== York Haskell Compiler (YHC) ==
+
=== Utrecht Haskell Compiler (UHC) ===
 
[[UHC]] is a Haskell implementation from Utrecht University. UHC supports almost all Haskell 98 and Haskell 2010 features plus many experimental extensions. The compiler runs on Mac OS X, Windows (Cygwin), and various Unix flavors.
[[Yhc]] is a fork of [http://www.haskell.org/nhc98/ nhc98], with the goals of being simpler, more portable, more efficient and integrating [[Hat]] support.
 
 
== [http://www.cs.chalmers.se/~augustss/hbc/hbc.html '''HBI''' and '''HBC'''], Chalmers' Haskell Interpreter and Compiler ==
 
The Chalmers Haskell-B compiler 0.9999.5c implements Haskell 98, as well as some extensions. It is written by Lennart Augustsson, and based on the classic LML compiler by Augustsson and Johnsson. The interpreter can also load code compiled with HBC. There has been no official release for the last few years and the support level is pretty low, but the compiler exists and can be used. Unfortunately the web-pages and the documentation has not been updated the last few years! You can download an unofficial [http://haskell.org/hbc/hbc-2004-06-29.src.tar.gz snapshot of the sources] and the corresponding [http://haskell.org/hbc/hbc-2004-06-29.bin-i386-linux.tar.gz x86 Linux binaries] (based on [http://www.cs.chalmers.se/pub/users/hallgren/Alfa/Haskell/ snapshots] from Thomas Hallgren and Magnus Carlsson).
 
 
== Helium ==
 
[http://www.cs.uu.nl/wiki/Helium Helium] is a functional programming language and a compiler designed especially for teaching Haskell. Quality of the error messages has been the main concern both in the choice of the language features and in the implementation of the compiler. The language is a subset of the Haskell language. The most notable difference with Haskell is the absence of overloading. The compiler keeps track of a lot of information to produce informative messages.
 
 
== Utrecht Haskell Compiler (UHC) ==
 
[http://www.cs.uu.nl/wiki/UHC UHC] is a Haskell implementation from Utrecht University. UHC supports almost all Haskell98 features plus many experimental extensions. The compiler runs on Mac OS X, Windows (cygwin), and various Unix flavors.
 
   
 
Features include: Multiple backends, including a bytecode interpreter backend and a whole-program analysis backend based on GRIN. Experimental language extensions, some of which have not been implemented before.
 
Features include: Multiple backends, including a bytecode interpreter backend and a whole-program analysis backend based on GRIN. Experimental language extensions, some of which have not been implemented before.
Line 33: Line 24:
 
On April 18, 2009 UHC was [http://www.cs.uu.nl/wiki/UHC/Announce announced] at the 5th Haskell Hackathon in Utrecht.
 
On April 18, 2009 UHC was [http://www.cs.uu.nl/wiki/UHC/Announce announced] at the 5th Haskell Hackathon in Utrecht.
   
  +
== Jhc ==
 
  +
=== LLVM Haskell Compiler (LHC) ===
  +
[https://github.com/Lemmih/lhc LHC] is a newly reborn project[http://lhc-compiler.blogspot.se/2014/11/the-new-lhc.html] to build a working Haskell 2010 compiler out of reusable blocks.
  +
  +
  +
=== MicroHs ===
  +
[https://github.com/augustss/MicroHs MicroHs] by [[Lennart Augustsson]] is using combinators for runtime execution.
  +
  +
== Haskell 98 ==
  +
 
=== Jhc Haskell Compiler ===
 
[http://repetae.net/computer/jhc/ Jhc] is an experimental compiler with a goal of testing new optimization methods and exploring the design space of Haskell implementations.
 
[http://repetae.net/computer/jhc/ Jhc] is an experimental compiler with a goal of testing new optimization methods and exploring the design space of Haskell implementations.
   
== LHC ==
+
=== Helium ===
 
[https://github.com/Helium4Haskell/helium Helium] is a functional programming language and a compiler designed especially for teaching Haskell. Quality of the error messages has been the main concern both in the choice of the language features and in the implementation of the compiler. The language is a subset of the Haskell language. The most notable difference with Haskell is the absence of overloading. The compiler keeps track of a lot of information to produce informative messages.
[http://lhc.seize.it/ LHC] initially started off as a fork of JHC, but changed toward being an alternative GHC backend, performing aggressive whole-program analysis on GHC's external core language.
 
  +
  +
== Haskell Dialects ==
  +
 
=== Discus ===
 
[http://www.discus-lang.org/ Discus] (formerly known as [http://disciple.ouroborus.net Disciple]) is a dialect of Haskell that uses strict evaluation as the default and supports destructive update of arbitrary data structures. Discus includes region, effect and closure typing, and this extra information provides a handle on the operational behaviour of code that isn't available in other languages. Programs can be written in either a pure/functional or effectful/imperative style, and one of our goals is to provide both styles coherently in the same language. Our compiler is still in the "research prototype" stage, but will compile programs if you are nice to it.
  +
  +
 
=== Frege ===
  +
  +
[https://github.com/Frege/frege Frege] is a pure functional programming language for the JVM in the spirit of Haskell. It enjoys a strong static type system with powerful type inference and non-strict - also known as lazy - evaluation.
  +
  +
Frege programs are compiled to Java and run on the JVM.
  +
  +
The similarity to Haskell is actually strong enough that many users call it "''a'' Haskell for the JVM".
  +
  +
  +
== Unmaintained ==
  +
 
=== Hugs ===
 
[[Hugs]] is a small, portable Haskell interpreter written in C runs on almost any machine. Hugs is best used as a Haskell program development system: it boasts extremely fast source code interpretation, supports incremental interpretation, and has the convenience of an interactive interpreter (within which one can move from module to module to test different portions of a program). However, being an interpreter, it does not nearly match the run-time performance of, for example, GHC, nhc98, or HBC. Hugs 98 is conformant with Haskell 98. Available for all Unix platforms including Linux, DOS, Windows 3.x, and Win 32 (Windows 95, Win32s, NT) and Macintoshes. It has many libraries including Win32 libraries, a foreign interface mechanism to facilitate interoperability with C, and the Windows version has a graphical user interface called [[WinHugs]]. Explanations of some common Hugs error messages and their causes can be found on [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/errors.html Simon Thompson's page].
  +
 
=== nhc98 ===
 
[http://www.haskell.org/nhc98/ nhc98] is a small, easy to install, standards-compliant Haskell 98 compiler. It works only on 32-bit machines. It provides some advanced kinds of heap profiles not found in any other Haskell compiler. It produces medium-fast code, and compilation is itself quite fast. The compiler stresses the saving of space, that is, it produces small programs requiring comparatively little space at runtime (and it is itself much smaller than the other compilers). It is available for all Unix-like platforms (including Mac OS X, Cygwin/Windows, Linux, Solaris, *BSD, AIX, HP-UX, Ultrix, IRIX, etc.). It is written in Haskell 98, but can be quickly and easily bootstrapped from C sources.
  +
  +
=== York Haskell Compiler (YHC) ===
 
[[Yhc]] is a fork of [http://www.haskell.org/nhc98/ nhc98], with the goals of being simpler, more portable, more efficient and integrating [[Hat]] support.
   
 
=== [http://web.archive.org/web/20090815181116/http://www.cs.chalmers.se/~augustss/hbc/hbc.html '''HBI''' and '''HBC'''], Chalmers' Haskell Interpreter and Compiler ===
== Yale Haskell ==
 
 
The Chalmers Haskell-B compiler 0.9999.5c implements Haskell 98, as well as some extensions. It is written by Lennart Augustsson, and based on the classic LML compiler by Augustsson and Johnsson. The interpreter can also load code compiled with HBC. There has been no official release for the last few years and the support level is pretty low, but the compiler exists and can be used. Unfortunately the web-pages and the documentation has not been updated the last few years! You can download an unofficial [http://haskell.org/hbc/hbc-2004-06-29.src.tar.gz snapshot of the sources] and the corresponding [http://haskell.org/hbc/hbc-2004-06-29.bin-i386-linux.tar.gz x86 Linux binaries] (based on [http://www.cs.chalmers.se/pub/users/hallgren/Alfa/Haskell/ snapshots] from Thomas Hallgren and Magnus Carlsson). Other sources: [https://archive.org/details/haskell-b-compiler https://archive.org/details/haskell-b-compiler].
[http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/syntax/haskell/0.html Yale Haskell 2.05], an early implementation of Haskell in Lisp. See an early [http://groups.google.com/group/comp.lang.functional/msg/5b929ac0223a6212?dmode=source&hl=en release announcement]
 
   
== Disciple ==
+
=== Yale Haskell ===
 
[http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/syntax/haskell/0.html Yale Haskell 2.05], an early implementation of Haskell in Lisp. See an early [http://groups.google.com/group/comp.lang.functional/msg/5b929ac0223a6212?dmode=source&hl=en release announcement]. More information is available on the [[Haskell Lisp]] page.
[http://disciple.ouroborus.net Disciple] is a dialect of Haskell that uses strict evaluation as the default and supports destructive update of arbitrary data structures. Disciple includes region, effect and closure typing, and this extra information provides a handle on the operational behaviour of code that isn't available in other languages. Programs can be written in either a pure/functional or effectful/imperative style, and one of our goals is to provide both styles coherently in the same language. Our compiler is still in the "research prototype" stage, but will compile programs if you are nice to it.
 
   
== The Brisk compiler ==
+
=== The Brisk compiler ===
A product of the [http://www.cs.bris.ac.uk/Research/LanguagesArchitecture/brisk.html BRISK project] at the University of Bristol investigating the further use of functional programming in systems-level software development. Version [http://www.cs.bris.ac.uk/~ian/Functional/brisk.tgz 0.08] partially implements an early version of Haskell.
+
A product of the [http://www.cs.bris.ac.uk/Research/LanguagesArchitecture/brisk.html BRISK project] at the University of Bristol investigating the further use of functional programming in systems-level software development. Version [http://www.cs.bris.ac.uk/~ian/Functional/brisk.tgz 0.08] partially implements an early version of Haskell.
   
  +
=== HasFuse: <u>Has</u>kell with <u>FU</u>NDIO-based <u>s</u>ide <u>e</u>ffects ===
  +
An experimental Haskell dialect, based on GHC 5.04.3 which has been [https://www2.ki.informatik.uni-frankfurt.de/papers/sabel/nondetIOinGHC.pdf modified] to use [https://www2.ki.informatik.uni-frankfurt.de/papers/schauss/FUNDIO.pdf FUNDIO] semantics to ease the use of I/O-centric code outside monadic contexts. More information can be found [https://www2.ki.informatik.uni-frankfurt.de/research/diamond/hasfuse/index.html here].
   
== Comparison of implementations ==
+
== Comparison of Implementations ==
* [http://mirror.seize.it/report.html Comparison of speed and memory usage of several Haskell implementations]. This page also shows how many samples compile/run correctly.
+
* Comparison of [https://web.archive.org/web/20160616121712/http://mirror.seize.it/report.html speed and memory usage (Web Archive)] of several Haskell implementations (February 2011). This page also shows how many samples compile/run correctly.
   
* [http://stackoverflow.com/questions/4084790/compilers-for-haskell A discussion of several implementations]
+
* A [http://stackoverflow.com/questions/4084790/compilers-for-haskell stackoverflow discussion] of several implementations.
   
   

Latest revision as of 15:57, 9 March 2024

Below you will find a list of all Haskell implementations. The recommended way to install Haskell on your computer is through GHCup and/or The Haskell Tool Stack.


Haskell 2010

Glasgow Haskell Compiler (GHC)

GHC is an optimising compiler for Haskell, providing many language extensions. GHC is the de facto standard compiler if you want fast code. GHC is written in Haskell (plus extensions), and its size and complexity mean that it is less portable than Hugs, it runs more slowly, and it needs more memory. However, the programs it produces run much faster.

There is also an interactive environment, GHCi, which is like Hugs but supports interactive loading of compiled code. GHC provides profiling for time and space, and supports concurrent and parallel programming. It is available for most common platforms, including Windows, Mac OS X, and several Unix variants (Linux, *BSD, Solaris).

The currently recommended way to install GHC and some related tools is with GHCup. There is also an installation guide for Stack.

Other methods of installation are listed at Distributions.

The previously recommended Haskell Platform is now deprecated.

Utrecht Haskell Compiler (UHC)

UHC is a Haskell implementation from Utrecht University. UHC supports almost all Haskell 98 and Haskell 2010 features plus many experimental extensions. The compiler runs on Mac OS X, Windows (Cygwin), and various Unix flavors.

Features include: Multiple backends, including a bytecode interpreter backend and a whole-program analysis backend based on GRIN. Experimental language extensions, some of which have not been implemented before.

UHC is implemented using attribute grammars, and due to an aspect-oriented internal organisation is ideally suited for experimenting with language extensions.

On April 18, 2009 UHC was announced at the 5th Haskell Hackathon in Utrecht.


LLVM Haskell Compiler (LHC)

LHC is a newly reborn project[1] to build a working Haskell 2010 compiler out of reusable blocks.


MicroHs

MicroHs by Lennart Augustsson is using combinators for runtime execution.

Haskell 98

Jhc Haskell Compiler

Jhc is an experimental compiler with a goal of testing new optimization methods and exploring the design space of Haskell implementations.

Helium

Helium is a functional programming language and a compiler designed especially for teaching Haskell. Quality of the error messages has been the main concern both in the choice of the language features and in the implementation of the compiler. The language is a subset of the Haskell language. The most notable difference with Haskell is the absence of overloading. The compiler keeps track of a lot of information to produce informative messages.

Haskell Dialects

Discus

Discus (formerly known as Disciple) is a dialect of Haskell that uses strict evaluation as the default and supports destructive update of arbitrary data structures. Discus includes region, effect and closure typing, and this extra information provides a handle on the operational behaviour of code that isn't available in other languages. Programs can be written in either a pure/functional or effectful/imperative style, and one of our goals is to provide both styles coherently in the same language. Our compiler is still in the "research prototype" stage, but will compile programs if you are nice to it.


Frege

Frege is a pure functional programming language for the JVM in the spirit of Haskell. It enjoys a strong static type system with powerful type inference and non-strict - also known as lazy - evaluation.

Frege programs are compiled to Java and run on the JVM.

The similarity to Haskell is actually strong enough that many users call it "a Haskell for the JVM".


Unmaintained

Hugs

Hugs is a small, portable Haskell interpreter written in C runs on almost any machine. Hugs is best used as a Haskell program development system: it boasts extremely fast source code interpretation, supports incremental interpretation, and has the convenience of an interactive interpreter (within which one can move from module to module to test different portions of a program). However, being an interpreter, it does not nearly match the run-time performance of, for example, GHC, nhc98, or HBC. Hugs 98 is conformant with Haskell 98. Available for all Unix platforms including Linux, DOS, Windows 3.x, and Win 32 (Windows 95, Win32s, NT) and Macintoshes. It has many libraries including Win32 libraries, a foreign interface mechanism to facilitate interoperability with C, and the Windows version has a graphical user interface called WinHugs. Explanations of some common Hugs error messages and their causes can be found on Simon Thompson's page.

nhc98

nhc98 is a small, easy to install, standards-compliant Haskell 98 compiler. It works only on 32-bit machines. It provides some advanced kinds of heap profiles not found in any other Haskell compiler. It produces medium-fast code, and compilation is itself quite fast. The compiler stresses the saving of space, that is, it produces small programs requiring comparatively little space at runtime (and it is itself much smaller than the other compilers). It is available for all Unix-like platforms (including Mac OS X, Cygwin/Windows, Linux, Solaris, *BSD, AIX, HP-UX, Ultrix, IRIX, etc.). It is written in Haskell 98, but can be quickly and easily bootstrapped from C sources.

York Haskell Compiler (YHC)

Yhc is a fork of nhc98, with the goals of being simpler, more portable, more efficient and integrating Hat support.

HBI and HBC, Chalmers' Haskell Interpreter and Compiler

The Chalmers Haskell-B compiler 0.9999.5c implements Haskell 98, as well as some extensions. It is written by Lennart Augustsson, and based on the classic LML compiler by Augustsson and Johnsson. The interpreter can also load code compiled with HBC. There has been no official release for the last few years and the support level is pretty low, but the compiler exists and can be used. Unfortunately the web-pages and the documentation has not been updated the last few years! You can download an unofficial snapshot of the sources and the corresponding x86 Linux binaries (based on snapshots from Thomas Hallgren and Magnus Carlsson). Other sources: https://archive.org/details/haskell-b-compiler.

Yale Haskell

Yale Haskell 2.05, an early implementation of Haskell in Lisp. See an early release announcement. More information is available on the Haskell Lisp page.

The Brisk compiler

A product of the BRISK project at the University of Bristol investigating the further use of functional programming in systems-level software development. Version 0.08 partially implements an early version of Haskell.

HasFuse: Haskell with FUNDIO-based side effects

An experimental Haskell dialect, based on GHC 5.04.3 which has been modified to use FUNDIO semantics to ease the use of I/O-centric code outside monadic contexts. More information can be found here.

Comparison of Implementations