Glasgow Haskell Compiler

Glasgow Haskell Compiler

Infobox_Software
name = Glasgow Haskell Compiler
developer = University of Glasgow
latest_release_version = 6.8.3
latest_release_date = Jun 17, 2008
operating_system = Cross-platform
genre = Compiler
license = BSD
website = [http://www.haskell.org/ghc/ GHC home]

The Glorious Glasgow Haskell Compilation System [ghc --version] cite web
title = The Glorious Glasgow Haskell Compilation System User's Guide, Version 6.6
url=http://www.haskell.org/ghc/docs/latest/html/users_guide/index.html
accessdate = 2007-01-28
authorlink = The GHC Team
] , more commonly known as the Glasgow Haskell Compiler or GHC, is an open source native code compiler for the functional programming language Haskell. The lead developers are Simon Peyton Jones and Simon Marlow.

History

GHC originally started in 1989 as a prototype, written in LML (Lazy ML) by Kevin Hammond at the University of Glasgow. Later that year, the prototype was completely rewritten in Haskell, except for its parser, by Cordelia Hall, Will Partain, and Simon Peyton Jones. Its first beta release was on April 1, 1991 and subsequent releases added a strictness analyzer as well as language extensions such as monadic I/O, mutable arrays, unboxed data types, and a profiler.cite conference
first = P.
last = Hudak
coauthors = Hughes, J.; Peyton Jones, S.; Wadler, P.
title = A history of Haskell: being lazy with class
booktitle = Proc. Third ACM SIGPLAN History of Programming Languages Conference (HOPL-III)
month = June | year = 2007
url = http://research.microsoft.com/~simonpj/papers/history-of-haskell/index.htm
]

Peyton Jones, as well as Simon Marlow, later moved to Microsoft Research in Cambridge, England, where they continue to be primarily responsible for developing GHC. GHC also contains code from more than sixty other contributors. cite web
title = The GHC Team
url=http://cvs.haskell.org/trac/ghc/wiki/Contributors
accessdate=2007-01-28
]

Architecture

GHC is itself written in Haskell (in a technique known as bootstrapping), but the runtime system for Haskell, an essential part of the compiler, is written in C and C--. Much of GHC is written in the literate programming style.

GHC's front end — incorporating the lexer, parser and typechecker — is designed to preserve as much information about the source language as possible until after type inference is complete, toward the goal of providing clear error messages to users. In its last phase, the front end desugars Haskell into a typed intermediate language known as "Core" (based on System F, extended with let and case expressions). Recently, Core was extended to support generalized algebraic datatypes in its type system, and is now based on an extension to System F known as System FC. [cite conference
first = M.
last = Sulzmann
authorlink = M. Sulzmann
coauthors = M. M. T. Chakravarty; S. Peyton Jones; K. Donnelly
title = System F with Type Equality Coercions
booktitle = Proc. Workshop on Types in Language Design and Implementation (TLDI)
month = January | year = 2007
url = http://research.microsoft.com/~simonpj/papers/ext-f/fc-tldi.pdf
]

In the tradition of type-directed compilation, GHC's simplifier, or "middle end", where most of the optimizations implemented in GHC are performed, is structured as a series of source-to-source transformations on Core code. The analyses and transformations performed in this compiler stage include demand analysis (a generalization of strictness analysis), application of user-defined rewrite rules (including a set of rules included in GHC's standard libraries that performs foldr/build fusion), unfolding (called "inlining" in more traditional compilers), let-floating, an analysis that determines which function arguments can be unboxed, constructed product result analysis, specialization of overloaded functions, as well as a set of simpler local transformations such as constant folding and beta reduction.cite conference
first = S.
last = Peyton Jones
title = Compiling Haskell by program transformation: a report from the trenches
booktitle = Proc. European Symposium on Programming (ESOP)
month = April | year = 1996
url = http://citeseer.ist.psu.edu/peytonjones96compiling.html
]

The final stage of the simplifier transforms Core code into STG (short for "Spineless Tagless G-machine"), a lower-level intermediate language. Like Core, STG is itself a functional language. STG also corresponds to an abstract machine. GHC's back end performs transformations on STG before translating it into C, C--, or native machine code (the traditional "code generation" phase).cite journal
first = S.
last = Peyton Jones
title = Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine, Version 2.5
journal = Journal of Functional Programming
volume = 2
issue = 2
pages = 127–202
month = April | year = 1992
url = http://citeseer.ist.psu.edu/peytonjones92implementing.html
] Emitted C or C-- code may then be used as an intermediate language before compiling to machine code.

Language

GHC complies with the latest language standard, called "Haskell 98".cite web
title = Haskell 98 Language and Libraries: The Revised Report
url = http://www.haskell.org/onlinereport/
accessdate = 2007-01-28
] It also supports many optional extensions to the Haskell standard: for example, the STM library, which allows for Composable Memory Transactions.

Portability

Versions of GHC are available for several platforms, including Windows and most varieties of Unix (such as the numerous GNU/Linux flavors and Mac OS X.) GHC has also been ported to several different processor architectures.

References

External links

* [http://www.haskell.org/ghc/ The GHC homepage]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Glasgow Haskell Compiler — Desarrollador Universidad de Glasgow http://www.haskell.org/ghc Información general Última versión estable 7.2.1 …   Wikipedia Español

  • Glasgow Haskell Compiler — Тип Компилятор Разработчик Университет Глазго Операционная система Кроссплатформенное программное обеспечение Последняя версия 7.6.1 (6 сентября 2012) Лицензия BSD …   Википедия

  • Glasgow Haskell Compiler — GHC Développeur Université de Glasgow, Dernière version …   Wikipédia en Français

  • Haskell (programming language) — Haskell Paradigm(s) functional, lazy/non strict, modular Appeared in 1990 Designed by Simon Peyton Jones, Lennart Aug …   Wikipedia

  • Haskell (Programmiersprache) — Haskell Basisdaten Paradigmen: funktional, nicht strikt, modular, deklarativ Erscheinungsjahr …   Deutsch Wikipedia

  • Haskell — Información general Paradigma Funcional, no estricto, modular, fuertemente tipificado Apareció en 1990 Diseñado por Universidad de Yale, Universidad de Glasgow …   Wikipedia Español

  • Haskell — Класс языка: функциональный, ленивый, модульный Тип исполнения: компилируемый, интерпретируемый Появился в: 1990 …   Википедия

  • Haskell — Auteur le comité Haskell Développeurs la communauté Haskell …   Wikipédia en Français

  • Glasgow (disambiguation) — Glasgow is the largest city in Scotland. Glasgow may also refer to: * University of GlasgowPlaces;Scotland *Glasgow City **Greater Glasgow Metropolitan Area **Glasgow (Scottish Parliament electoral region), an electoral region in the Scottish… …   Wikipedia

  • Glasgow (homonymie) — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Glasgow désigne : Toponymes  Écosse Glasgow, la plus grande ville de l’Écosse Port Glasgow, Inve …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”