Installing GF on Windows

Inari Listenmaa
inari.listenmaa@gmail.com
July 2013–August 2025

1. Install GF

Easiest option: download and unpack Windows binary package

Go to the page grammaticalframework.org/download and download the Windows package, a zip file named gf-<VERSION>-bin-windows.zip. As of August 2025, the latest version is gf-3.12.

See section 2 for setting up environment variables.

Alternative options: compile from source or install from Hackage

See general instructions on GF website. If you want to compile from source on Windows, we recommend using WSL, and then following Linux instructions on Developers' guide.

If you run into problems on Windows, please report it on GitHub issues.

2. Add GF to your PATH

You need to edit or create an environment variable called Path. If you don't know where to edit environment variables, you can search google.com/search?hl=en&q=windows 10 environment variables.

Setting environment variables for the path C:\Users\2jtsm\OneDrive\Documents\Grammatical-Framework-tutorial\gf-3.10 The picture shows the environment variables of a user who downloaded the GF binary in the location shown in the picture.

With this step, you can use GF from command line.

3. Install the Resource Grammar Library and create GF_LIB_PATH

See instructions on how to install the Resource Grammar Library from a binary release or compiling from source.

After you have obtained the RGL, you need to create a new environment variable called GF_LIB_PATH. The process is the same as with the previous environment variable (Path). Just remember where you downloaded and unpacked the RGL, and set the full path of the library (e.g. C:\\TODO\some\example\and\screenshot) as the value.

With this step, you can import RGL modules in the GF shell from anywhere.

Possible problems

UTF-8 decoding error while compiling (while compiling from source)
For the error message
    <built-in>:0:4: lexical error (UTF-8 decoding error)
write set lang=C in the command prompt and try cabal install or stack install again.


Invalid characters (while using GF)
First, a warning: Windows can be still very difficult with encodings.
Some solutions:
  1. Check your font. If you are using raster fonts, they can't display all characters. Right click your command prompt, go to Properties and Font tab, and choose Lucida or Consolas.
  2. Check your code page. Type chcp in your command prompt to see your active code page. You can change it to Latin 1 by typing chcp 1252, Latin 2 by typing chcp 852, etc. -- see list of code pages. In principle you can change it to UTF-8 by typing chcp 65001, but there are problems with GF, it might not work.
    • You can change the code page also when you are running the GF shell. To give any system command without leaving GF, just write a ! before the command. ! chcp shows you the code page and ! chcp XXXX changes it.

Out of memory when linking (while using GF)
This is not a Windows-specific problem, it happens with some bigger .gfo files. You can start GF giving it a little more memory. For 100 MB, start GF by typing gf +RTS -K100M -RTS in the command prompt.

Libraries not found (while using GF)
When you try to import e.g. LangIta.gfo, it says something like
None of these files exists:
  LangIta.gfo
  C:\Users\YourName\SomePath\LangIta.gfo
Look at the second line prior to the filename (C:\...\SomePath\). Is it really the path where you have your libraries? If not, go change (or create) your GF_LIB_PATH environment variable, see instructions at section 3.

Something else
Report the issue on GitHub.
For interactive help, join the GF Discord server and explain your problem on the channel #questions.
You can also ask by email: join the gf-dev mailing list and search for your problem/send your question.