# grin-compiler/grin

GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.

Repository: https://github.com/grin-compiler/grin
Canonical: https://ross.abutalabs.com/products/grin-compiler-grin
Homepage: https://grin-compiler.github.io/
Language: Haskell
License Family: other
Topics: optimisation, compiler, haskell, llvm, data-flow-analysis, functional-programming
Last push: 2025-06-13T11:21:35+00:00

## Health v2 (maintenance only)
Score: 34/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 26, release rhythm 8, longevity 100
- inputs: {"age_days": 3358, "days_push": 446, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1080, forks 41 (observed 2026-08-28T04:03:30.422326+00:00)

## What it is
GRIN (Graph Reduction Intermediate Notation) is a compiler back-end and optimizer for lazy and strict functional languages, providing whole-program optimization and code generation. It includes language frontends for Haskell, Idris, and Agda and can target backends like LLVM and WebAssembly.

## Use cases
- optimize compiled Haskell programs with whole-program analysis
- compile functional languages to smaller and faster binaries
- target WebAssembly from a functional language
- research graph reduction and functional language optimization techniques
- improve the code generation pipeline of Idris
- experiment with alternative Haskell compiler backends

## When to choose
- you are building or improving a compiler for a lazy or strict functional language
- you need whole-program optimization beyond what LLVM provides
- you are researching functional language compilation and graph reduction
- you want to compile Haskell, Idris, or Agda code to new targets like WebAssembly

## When to avoid
- you need a production-ready, stable Haskell compiler today - GHC/GRIN is work in progress
- you only need standard LLVM-level optimization for imperative languages
- you need guaranteed runtime support - Idris/GRIN runtime is incomplete and Agda/GRIN is a stub
- you require a permissively licensed dependency - the repository lists no license

## Facets
- artifact type: library
- maturity: active
- function: compiler, build-tool
- domain: compilers, programming-languages, performance
- platform: cpp
- tags: intermediate-representation, whole-program-optimization, graph-reduction, haskell-compiler, llvm-backend, wasm-targeting, research-compiler, functional-programming, linux, macos, llvm

## Member repositories
- grin-compiler/grin (main) score 34

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:30.422326+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:51:28.325854+00:00, confidence not recorded.
  - readme: https://github.com/grin-compiler/grin (fetched 2026-08-28T04:03:30.422326+00:00, sha a113a89664b1)
  - homepage: https://grin-compiler.github.io/ (fetched 2026-08-29T12:53:45.383310+00:00, sha c73c96d6f4be)
- Data as of 2026-08-30T08:39:29.467469+00:00.
