# Grammatical Framework Version 2.2

Highlights of GF version 2.2.

9/5/2005

Aarne Ranta

## Summary of novelties in Version 2.2 in comparison to 2.1

- New optimizations to reduce the size of GFC files
- Improved parsing algorithms
- Lots of bug fixes
- Separate `reuse` modules no longer needed
- Several new command options
- New documentation:
  - module system document
  - new tutorial, based on the module system (unfinished)
- New resource libraries
- Visualization of module dependency graph
- In the editor GUI, text corresponding to subtrees with constraints marked with red colour
- Hierarchic modules used in the source code
- haddock documentation available for source code

  ### Compiler optimizations

  The sometimes exploding size of generated `gfc` and `gfr` files has made it urgent to find optimizations that reduce the size of the code. There are five combinations optimizations that can be chosen, as the value of the `optimize` flag:
  - `share`: group tables so that common branch values are shared by the use of disjunctive patterns.
  - `parametrize`: if table branches differ at most at the occurrence of the pattern, replace the expanded table by a one-branch table with a variable. If this fails, perform `share`.
  - `values`: only show the values of table branches, not the patterns.
  - `all`: try `parametrize`; if this fails, do `values`.
  - `none`: don't do any optimizations
  The `share` and `parametrize` optimizations are always just good, whereas the `values` optimization may slow down the use of the table. However, it is very good for grammars mostly consisting of the inflection tables of lexical items: it can reduce the file size by the factor of 4.

  An optimization can be selected individually for each `resource` and `concrete` module by including the judgement

        flags optimize=(share|parametrize|values|all|none) ;

  in the module body. These flags can be overridden by a flag given in the `i` command, e.g.

        i -src -optimize=none Foo.gf

  Notice that the option `-src` is needed if there already are generated files created with other optimization flags.