LLMpediaThe first transparent, open encyclopedia generated by LLMs

Core (GHC)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Simon Peyton Jones Hop 5
Expansion Funnel Raw 54 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted54
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Core (GHC)
NameCore (GHC)
DesignerSimon Peyton Jones, Simon Marlow, Simon Marlow
DeveloperGlasgow Haskell Compiler, Microsoft Research, Yale University
Introduced2000s
ParadigmFunctional programming, Lambda calculus, Type theory
Latest releaseGHC developments
Influenced bySystem F, Lambda calculus, Hindley–Milner algorithm

Core (GHC) is an intermediate language used within the Glasgow Haskell Compiler pipeline to represent programs during transformation, optimization, and code generation. Core acts as a small, explicitly typed, polymorphic lambda calculus that bridges high-level constructs from Haskell 2010, Haskell 98, and extensions with backends targeting platforms such as x86 architecture, ARM architecture, and JavaScript. Core is central to many research projects and practical implementations involving compilers like LLVM, optimizers like GHC CoreOpt, and analyses from institutions such as Microsoft Research, University of Cambridge, and Princeton University.

Overview

Core is a strongly-typed, explicitly-typed intermediate representation derived from System F and enriched with features from Type theory and the Hindley–Milner algorithm. It serves as the basis for numerous compiler passes undertaken by the Glasgow Haskell Compiler team led by researchers including Simon Peyton Jones and Simon Marlow. Core enables transformations used in projects at Microsoft Research, Yale University, University of Oxford, MIT, and Stanford University where formal reasoning about program properties intersects with practical code generation for targets like x86 architecture and ARM architecture. Core interacts with language standards such as Haskell 2010 and tools such as LLVM, GHCi, and Heap profiling utilities.

Language and Syntax

Core's syntax is a minimal, explicitly-typed variant of the lambda calculus, incorporating constructs inspired by System F and type system research from Cambridge University Press-associated authors. Core programs use type abstractions and applications, let-bindings, case expressions, and primitive operations found in backends like LLVM and GHCi. The language reflects semantics considered in texts like Types and Programming Languages and research by contributors from Carnegie Mellon University, Harvard University, and Princeton University. Core's typing discipline echoes ideas from Hindley–Milner algorithm and formalizations used in verifier projects at ETH Zurich and Max Planck Institute.

Compilation and Optimization

Within the Glasgow Haskell Compiler pipeline, Haskell source code from Haskell 2010 is desugared into Core before a sequence of optimizations including inlining, lambda lifting, fusion, and specialization. These transformations are influenced by work from Simon Peyton Jones and optimization frameworks found in LLVM and research at Microsoft Research. Core enables optimizers that perform rewrite rules akin to those used in GHC CoreOpt and inlining heuristics studied at Stanford University, University of Cambridge, and Imperial College London. Backend code generation for platforms such as x86 architecture, ARM architecture, PowerPC, and WebAssembly leverages optimized Core representations, with contributions from teams at NVIDIA, Intel Corporation, and Mozilla.

Runtime Semantics

Core's semantics underpin runtime models such as the STG machine and graph-reduction implementations used by the Glasgow Haskell Compiler runtime system. Operational semantics for Core are aligned with reductions studied in Lambda calculus research at University of Edinburgh and formal verification efforts at INRIA and University of Cambridge. Runtime considerations informed by analyses from GHCi, LLVM, and projects at Microsoft Research include strictness analysis, garbage collection strategies as in Boehm–Demers–Weiser garbage collector research, and interaction with concurrency primitives inspired by work at Bell Labs and IBM Research.

Tools and Implementations

Tooling around Core includes introspection via GHCi and visualization/analysis utilities developed in academia and industry, with contributions from Microsoft Research, Facebook AI Research, and Google Research. Implementations of Core-centric tooling appear in compiler frameworks like GHC, research compilers at University of Oxford, and intermediate language toolchains built on LLVM and MLIR. Projects leveraging Core for verification and transformations have occurred at INRIA, ETH Zurich, Princeton University, University of Toronto, and Cornell University. Commercial usage and integrations have been explored by Microsoft Corporation, Facebook, and Google.

Examples and Use Cases

Core is used for advanced program analyses, optimization experiments, and language research in settings such as GHCi interactive sessions, academic courses at MIT, Stanford University, and University of Cambridge, and industrial compiler engineering at Microsoft Research, Intel Corporation, and NVIDIA. Example uses include fusion transforms inspired by work at EPFL, correctness proofs undertaken at INRIA and Max Planck Institute, and code generation targets including x86 architecture, ARM architecture, WebAssembly, and JVM. Core also appears in projects integrating Haskell frontends with backends like LLVM, MLIR, and runtime systems developed at Facebook AI Research and Google Research.

Category:Glasgow Haskell Compiler