gf: Grammatical Framework

[ compiler, library, natural-language-processing, program ] [ Propose Tags ] [ Report a vulnerability ]

GF, Grammatical Framework, is a programming language for multilingual grammar applications


[Skip to Readme]

Modules

[Last Documentation]

  • GF
    • Grammar
      • GF.Grammar.Canonical
    • GF.Support
    • Text
      • GF.Text.Lexing
      • GF.Text.Pretty
  • PGF
    • PGF.Haskell
    • PGF.Internal
  • PGF2

Flags

Automatic Flags
NameDescriptionDefault
interrupt

Enable Ctrl+Break in the shell

Enabled
server

Include --server mode

Enabled
network-uri

Get Network.URI from the network-uri package

Enabled
c-runtime

Include functionality from the C run-time library (which must be installed already)

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 3.1.6, 3.1.6.1, 3.1.6.2, 3.2, 3.2.9, 3.3, 3.3.3, 3.4, 3.5, 3.6, 3.7, 3.7.1, 3.8, 3.9, 3.10, 3.11, 3.11.0, 3.12.0 (info)
Change log CHANGELOG.md
Dependencies array (>=0.5.1 && <0.6), base (>=4.9.1 && <4.22), bytestring (>=0.10.8 && <0.12), cgi (>=3001.3.0.2 && <3001.6), containers (>=0.5.7 && <0.7), directory (>=1.3.0 && <1.4), exceptions (>=0.8.3 && <0.11), fail (>=4.9.0 && <4.10), filepath (>=1.4.1 && <1.5), gf, ghc-prim (>=0.5.0 && <=0.10.0), haskeline (>=0.7.3 && <0.9), httpd-shed (>=0.4.0 && <0.5), json (>=0.9.1 && <=0.11), mtl (>=2.2.1 && <=2.3.1), network (>=2.5 && <3.2), network-uri (>=2.6.1.0 && <2.7), parallel (>=3.2.1.1 && <3.3), pretty (>=1.1.3 && <1.2), process (>=1.4.3 && <1.7), random (>=1.1 && <1.3), template-haskell (>=2.13.0.0 && <2.21), terminfo (>=0.4.0 && <0.5), time (>=1.6.0 && <=1.12.2), transformers-compat (>=0.6.3 && <0.7), unix (>=2.7.2 && <2.9), utf8-string (>=1.0.1.1 && <1.1), Win32 (>=2.3.1.1 && <2.7) [details]
Tested with ghc ==7.10.3, ghc ==8.0.2, ghc ==8.10.4, ghc ==9.0.2, ghc ==9.2.4, ghc ==9.6.7
License LicenseRef-OtherLicense
Author
Maintainer John J. Camilleri <john@digitalgrammars.com>
Category Natural Language Processing, Compiler
Home page https://www.grammaticalframework.org/
Bug tracker https://github.com/GrammaticalFramework/gf-core/issues
Source repo head: git clone https://github.com/GrammaticalFramework/gf-core.git
Uploaded by anka213 at 2025-08-08T19:06:01Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables gf
Downloads 14768 total (54 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2025-08-08 [all 2 reports]

Readme for gf-3.12.0

[back to package description]

GF Logo

Grammatical Framework (GF)

The Grammatical Framework is a grammar formalism based on type theory. It consists of:

  • a special-purpose programming language
  • a compiler of the language
  • a generic grammar processor

The compiler reads GF grammars from user-provided files, and the generic grammar processor performs various tasks with the grammars:

  • generation
  • parsing
  • translation
  • type checking
  • computation
  • paraphrasing
  • random generation
  • syntax editing

GF particularly addresses four aspects of grammars:

  • multilinguality (parallel grammars for different languages)
  • semantics (semantic conditions of well-formedness, semantic properties of expressions)
  • grammar engineering (modularity, abstractions, libraries)
  • embeddability in programs written in other languages (C, C++, Haskell, Java, JavaScript)

Compilation and installation

The simplest way of installing GF from source is with the command:

cabal install

or:

stack install

Note that if you are unlucky to have Cabal 3.0 or later, then it uses the so-called Nix style commands. Using those for GF development is a pain. Every time when you change something in the source code, Cabal will generate a new folder for GF to look for the GF libraries and the GF cloud. Either reinstall everything with every change in the compiler, or be sane and stop using cabal-install. Instead you can do:

runghc Setup.hs configure
runghc Setup.hs build
sudo runghc Setup.hs install

The script will install the GF dependencies globally. The only solution to the Nix madness that I found is radical:

"No person, no problem" (Нет человека – нет проблемы).

For more information, including links to precompiled binaries, see the download page.

About this repository

On 2018-07-25, the monolithic GF repository was split in two:

  1. gf-core — the GF compiler, shell and runtimes
  2. gf-rgl — the resource grammar library

The former repository is now archived and no longer updated. The split was performed using this script and the output of that script is here.